Retrofit automatic seismic wave detector and valve shutoff device

ABSTRACT

A retrofit valve shutoff device is provided that comprises a coupling key for coupling with an actuator of a shutoff valve on a fluid supply line, an inertial measurement unit for generating one or more signals in response to arrival of seismic waves, a motor for rotating the coupling key and the actuator of the shutoff valve, and a processing unit for receiving the one or more signals from the inertial measurement unit, analyzing the received signals to determine whether to close the shutoff valve, and sending a signal to the motor to rotate the coupling key and the actuator of the shutoff valve to close the shutoff valve based on the analysis of the received signals.

CLAIM OF BENEFIT TO PRIOR APPLICATIONS

This application claims the benefit of U.S. Provisional PatentApplication Ser. No. 62/788,723, filed on Jan. 4, 2019. The contents ofU.S. Provisional Patent Application No. 62/788,723 are herebyincorporated by reference.

BACKGROUND

Automatic shut off valves have been used to shut off the gas supply to astructure during an earthquake. The shutoff of the flow of gas frompipes that may be ruptured during an earthquake prevents a fire orexplosion due to a gas leak caused by the earthquake.

The automatic shut off valves are typically installed in a gas flowline. The existing automatic shut off valves use mechanical mechanismsto sense the shock and vibrations of an earthquake. Some of theautomatic shut off valves use a metal ball which is displaced by theforce of an earthquake from its normal rest position to cause the valveto close.

Other automatic shut off valves use a pivoted flapper arm that is heldin open position (i.e., out of the line of the gas flow) by a holdingmagnet embedded in it. When the magnetic attractive force is reduced(e.g., an electromagnet may be activated after an earthquake, whichopposes the field of the holding magnet), the pivoted flapper arm swingsdown by gravity into the closed position and a flapper seal elementseals the valve seat. The flapper arm may also be released by a ballthat normally rests in a cavity above the flapper's magnet to keep theflapper up and the valve open. The ball moves away from its restingposition by the force of an earthquake causing the flapper to bereleased to close the valve.

BRIEF DESCRIPTION OF THE DRAWINGS

The various embodiments of the present retrofit automatic seismic wavedetector and valve shutoff device now will be discussed in detail withan emphasis on highlighting the advantageous features. These embodimentsdepict the novel and non-obvious retrofit automatic seismic wavedetector and valve shutoff device shown in the accompanying drawings,which are for illustrative purposes only. These drawings include thefollowing figures, in which like numerals indicate like parts:

FIG. 1A is a schematic front view of an automatic valve shutoff deviceprior to installation on a fluid supply line's shutoff valve, accordingto various aspects of the present disclosure;

FIG. 1B is a schematic front view of the automatic valve shutoff deviceof FIG. 1A after installation on the fluid supply line's shutoff valve,according to various aspects of the present disclosure;

FIG. 2 is a functional diagram showing the manual closing of a gasshutoff valve, according to prior art;

FIG. 3 is a schematic front view of a pair of clamps that are used totie an automatic valve shutoff device as a retrofit on a fluid supplyline, according to various aspects of the present disclosure;

FIG. 4 is a perspective view of an automatic valve shutoff device thatis connected, as a retrofit, by several clamps to a fluid supply line,according to various aspects of the present disclosure;

FIG. 5 is a schematic front view of an automatic valve shutoff devicethat is installed and tied as a retrofit on a fluid supply line,according to various aspects of the present disclosure;

FIG. 6A is a schematic side view of the rotor shaft of a valve shutoffdevice, according to various aspects of the present disclosure.

FIG. 6B is a schematic front view of the rotor shaft of FIG. 6A,according to various aspects of the present disclosure;

FIG. 7A is a perspective view of a valve coupling key, according tovarious aspects of the present disclosure;

FIG. 7B is a schematic top view of the valve coupling key of FIG. 7A,according to various aspects of the present disclosure;

FIG. 7C is a schematic front view of the valve coupling key of FIG. 7A,according to various aspects of the present disclosure;

FIG. 8 is a perspective view of a portion of a gate valve's handwheel,according to prior art;

FIG. 9A is a perspective view of a valve coupling key that may be usedto rotate a handwheel of a gate valve, according to various aspects ofthe present disclosure;

FIG. 9B is a schematic top view of the valve coupling key of FIG. 9A,according to various aspects of the present disclosure;

FIG. 9C is a schematic front view of the valve coupling key of FIG. 9A,according to various aspects of the present disclosure;

FIG. 10 is a schematic front view of a ball valve that includes a handlefor opening and closing of the valve, according to prior art;

FIG. 11A is a perspective view of a valve coupling key that may be usedto rotate the handle of a ball valve, according to various aspects ofthe present disclosure;

FIG. 11B is a schematic top view of the valve coupling key of FIG. 11A,according to various aspects of the present disclosure;

FIG. 11C is a schematic front view of the valve coupling key of FIG.11A, according to various aspects of the present disclosure;

FIG. 12A is a functional block diagram illustrating an example systemfor an automatic valve shutoff device that includes a force or torquelimit detector, according to various aspects of the present disclosure;

FIG. 12B is a functional block diagram illustrating an example systemfor an automatic valve shutoff device that includes a motor currentlimit detector, according to various aspects of the present disclosure;

FIG. 12C is a functional block diagram illustrating an example systemfor an automatic valve shutoff device that includes a rotary positionencoder limit detector, according to various aspects of the presentdisclosure;

FIG. 13A is a functional diagram showing a force or torque limitdetector, according to various aspects of the present disclosure;

FIG. 13B is a functional diagram showing motor current limit detector,according to various aspects of the present disclosure;

FIG. 13C is a perspective view of an optical rotary position encoderinstalled on the rotor shaft of the valve shutoff device, according tovarious aspects of the present disclosure;

FIG. 13D is a schematic front view of a magnetic rotary position encoderinstalled on the rotor shaft of the valve shutoff device, according tovarious aspects of the present disclosure;

FIG. 14 is a functional diagram showing different types of seismicwaves, according to prior art;

FIGS. 15A and 15B are functional diagrams illustrating the orientationof local coordinates versus the coordinates used by an accelerometer ofa valve shutoff device, according to various aspects of the presentdisclosure;

FIG. 16 is a functional diagram illustrating the rotation between thegeographical north and the magnetic north at an exemplary location wherea valve shutoff device is installed, according to various aspects of thepresent disclosure;

FIG. 17 is a flowchart illustrating an example process for performing aninitial setup for identification and determination of the intensity ofseismic activities, according to various aspects of the presentdisclosure;

FIG. 18 is a flowchart illustrating an example process 1800 forperforming the rotational coordinate transformation from the (x′, y′,z′) coordinates used by the IMU to the local coordinates (x, y, z),according to various aspects of the present disclosure;

FIG. 19 is a flowchart illustrating an example process for identifyingP-waves related to seismic activities, according to various aspects ofthe present disclosure;

FIG. 20 is a flowchart illustrating an example process for identifyingthe S-waves related to seismic activities, according to various aspectsof the present disclosure;

FIG. 21 is a flowchart illustrating an example process for identifyingthe surface waves related to seismic activities, according to variousaspects of the present disclosure;

FIG. 22 is a flowchart illustrating an example process for closing ashutoff valve on a fluid supply line after the surface waves related toseismic activities exceed a threshold, according to various aspects ofthe present disclosure;

FIG. 23 is a flowchart illustrating an example process for turning of ashutoff valve, which has a mechanical stop, by a processing unit basedon the analysis of seismic waves, according to various aspects of thepresent disclosure;

FIG. 24 is a flowchart illustrating an example process for turning off ashutoff valve, which has a mechanical stop, by a motor that has positioncontrol, according to various aspects of the present disclosure;

FIG. 25 is a schematic front view of a client device that may include anapplication program for identifying the position of the rotor shaft whenthe valve is on or off, according to various aspects of the presentdisclosure;

FIG. 26 is a flowchart illustrating an example process for identifyingthe on and off positions of a shutoff valve, according to variousaspects of the present disclosure;

FIG. 27 is a flowchart illustrating an example process for turning off ashutoff valve by a continuous rotation motor using the stored angularpositions of the rotor shaft that correspond to the “on” and/or “off”positions of the shutoff valve, according to various aspects of thepresent disclosure;

FIG. 28 is a flowchart illustrating an example process for turning off ashutoff valve by a motor that has position control using the storedangular positions of the rotor shaft that correspond to the “on” and/or“off” positions of the shutoff valve, according to various aspects ofthe present disclosure;

FIG. 29 is a functional block diagram illustrating a system for remotelyturning a shutoff valve on or off by a cloud or backend server using avalve shutoff device, according to various aspects of the presentdisclosure;

FIG. 30 is a functional block diagram illustrating a system for remotelyturning a shutoff valve on or off by a client device using a valveshutoff device, according to various aspects of the present disclosure;

FIG. 31 is a schematic front view of a client device that may include anapplication program for remotely turning a shutoff valve on or off,according to various aspects of the present disclosure;

FIG. 32 is a flowchart illustrating an example process for using acontinuous rotation motor to open or close a shutoff valve that has amechanical stop, in response to receiving a signal from a remote device,according to various aspects of the present disclosure;

FIG. 33 is a flowchart illustrating an example process for using a motorthat has position control to turn a shutoff valve that has a mechanicalstop on or off, in response to receiving a signal from a remote device,according to various aspects of the present disclosure;

FIG. 34 is a flowchart illustrating an example process for opening orclosing a shutoff valve by a continuous rotation motor using the storedangular positions of the rotor shaft that correspond to the open orclose positions of the shutoff valve, in response to receiving a signalfrom a remote device, according to various aspects of the presentdisclosure;

FIG. 35 is a flowchart illustrating an example process for opening orclosing a shutoff valve by a motor that has position control using thestored angular positions of the rotor shaft that correspond to the openor close positions of the shutoff valve, in response to receiving asignal from a remote device, according to various aspects of the presentdisclosure;

FIG. 36 is a functional block diagram illustrating a system forreporting health status and data by one or more valve shutoff devices toone or more external devices, according to various aspects of thepresent disclosure;

FIG. 37 is a functional block diagram illustrating a system forreporting health status and data by a valve shutoff device to one ormore client devices associated with the valve shutoff device, accordingto various aspects of the present disclosure;

FIG. 38 is a flowchart illustrating an example process for collectinghealth status and data by a valve shutoff device and reporting thehealth status and data to one or more external devices, according tovarious aspects of the present disclosure;

FIG. 39 is a schematic front view of a client device that may include anapplication program for displaying health and status data collected by ashutoff valve on or off, according to various aspects of the presentdisclosure; and

FIG. 40 is a schematic front view of a light panel of an automatic valveshutoff device, according to various aspects of the present disclosure.

DETAILED DESCRIPTION

One aspect of the present embodiments includes the realization that theexisting automatic shutoff valves use a mechanical component such as aball or mass to detect movements related to seismic activities. Suchsystems require to be installed in a flat area and the ball may move dueto vibration resulted from activities such as passing a vehicle or anyother man-made vibrations that are unrelated to seismic activities.

The existing shutoff valves are typically installed inline to the fluidsupply line and may require the expertise of an expert installer to cutthe fluid pipe open and install the automatic valve shutoff deviceinline the fluid pipe. The use of a mechanical component to detectseismic activity may only approximately determine the intensity of theseismic waves. The exiting automatic valve shutoff devices do notinclude transceivers, cannot be remotely controlled, and do not providehealth status and data to external devices.

The present embodiments, as described in detail below, solve theabove-mentioned problems by providing an automatic valve shutoff devicethat may be installed as a retrofit device to engage and automaticallyrotate the manual shutoff valve of a fluid supply line without a needfor cutting the fluid supply line open and installing the automaticshutoff valve inside the fluid supply line. The valve shutoff device mayinclude one or more inertial measurement units or sensors to measureparameters related to seismic waves such as the primary, secondary, andsurface waves caused by an earthquake. The valve shutoff device mayinclude a processing unit to receive the measured seismic wave'sparameters and use an algorithm to identify and determine the intensityof the seismic activities. The valve shutoff device may, therefore,determine the precise intensity of the seismic activities using themeasured parameters of the seismic waves instead of using mechanicalmeans to determine ground movements.

The processing unit may use an algorithm that distinguishes the seismicwaves from man-made vibrations. The processing unit may band filter theparameters measured by the inertial measurement unit to limit theseparameters to one or more frequency bands associated with seismic waves.The processing unit, by eliminating the parameters associated withfrequencies outside the seismic waves' frequency bands, eliminates thepossibility of false positives caused by vibrations unrelated to theseismic activities triggering the closure of the shutoff valve.

The valve shutoff device may include a motor that may rotate a rotorshaft and a coupling key that is connected to the manual shutoff valve.The processing unit may send one or more signals to start of stop themotor to rotate the rotor shaft, the coupling key, and the manualshutoff valve in order to open or close the shutoff valve.

The processing unit may collect health status and data from differentcomponents of the valve shutoff device. The valve shutoff device mayinclude a transceiver and an antenna. The processing unit may send thehealth and status data to one or more external devices such as one ormore authorized client devices or one or more authorized cloud orbackend servers. The processing unit may turn on or off the shutoffvalve in response to signals received from the authorized externaldevices. The valve shutoff device may, therefore, operate as an Internetof Things (IoT) device.

The remaining detailed description describes the present embodimentswith reference to the drawings. In the drawings, reference numbers labelelements of the present embodiments. These reference numbers arereproduced below in connection with the discussion of the correspondingdrawing features.

Some of the present embodiments provide an automatic valve shutoffdevice that is externally installed as a retrofit over an existingmanual fluid supply line shutoff valve. FIG. 1A is a schematic frontview of an automatic valve shutoff device prior to installation on afluid supply line's shutoff valve, according to various aspects of thepresent disclosure. FIG. 1B is a schematic front view of the automaticvalve shutoff device of FIG. 1A after installation on the fluid supplyline's shutoff valve, according to various aspects of the presentdisclosure.

With reference to FIGS. 1A and 1B, the valve shutoff device 100 mayinclude one or more solar cells 105, a rechargeable battery 110, a motor115, a processing unit 120, a radio transceiver 125, an antenna 130, aninertial measurement unit (IMU) 135, a housing 140, a valve coupling key145, a rotor shaft 150, a gearbox 155, and a limit detector 160.Although the motor 115, the gearbox 155, and the rotor shaft 150 areshown as separate components, in some of the present embodiments, therotor shaft 150 and the gearbox 155 may be an integral part of the motor115. The gearbox 155 may include one or more gears for transferring therotational movement of the rotor shaft 150 to the valve coupling key145.

The valve shutoff device 100 may be used as a retrofit device toautomatically turn off an existing manual shutoff valve 175 of a fluidsupply line 170. Examples of the fluid supply line 170 may include,without limitations, gas supply lines, liquid water supply lines, watervapor supply lines, fuel or other petroleum-derived supply lines, etc.The fluid supply line 170 may receive fluid from a main supply line (asshown by 185) and may supply the fluid (as shown by 190) to a structuresuch as a residential or commercial building.

The fluid supply line 170 may include a manual shutoff valve 175. Themanual shutoff valve 175 may be, for example and without limitations, aball valve or a gate valve. The manual shutoff valve 175 may include ashutoff valve actuator 180 (for example and without limitations, alever, a handle, a handwheel, etc.) that is intended for a human tomanually turn off or turn on the fluid supply through the fluid supplyline. As described herein, the automatic valve shutoff device 100 ofsome of the present embodiments engages with the shutoff valve actuator180 of the manual shutoff valve 175 and automatically rotates theshutoff valve actuator 180 when seismic activities exceed a threshold orwhen the automatic valve shutoff device 100 receives a signal from anexternal electronic device such as a client device or a server to turnthe shutoff valve 175 on or off.

FIG. 2 is a functional diagram showing the manual closing of a gasshutoff valve, according to prior art. With reference to FIG. 2, thefluid, in this example gas, is delivered through the pipe 270 from amain supply line to a structure (as shown by the arrows 285 and 280,respectively). The gas delivery system may include a meter 220 todetermine the amount of gas delivered and a regulator 215 to deliver asteady flow of gas downstream from the main supply line to thestructure.

With further reference to FIG. 2, the manual shutoff valve 175 includesa shutoff valve actuator 180 (in this example a lever). A specializedwrench or key 225 may be used to turn the actuator 180 by a human toclose (as shown by 210) or open (as shown by 205) the manual shutoffvalve 175. Some shutoff valve actuators may only turn by one quarterturn (i.e., by 90 degrees) in one direction to close the valve and byone quarter turn in the opposite direction to open the valve. Othershutoff valves may freely rotate. In either case, typically when theshutoff valve actuator 180 is parallel to the pipe 270 (as shown by 205)the gas flows through the pipe 270 and when the shutoff valve actuator180 is perpendicular to the pipe 270 (as shown by 210) the gas stopsflowing through the pipe 270. A water shutoff valve may operate similarto the gas shutoff valve of FIG. 2 or may include a gate valve with ahandwheel (as described below with reference to FIG. 8) or a ball valvewith a handle (as described below with reference to FIG. 10).

As described herein, in some of the present embodiments, the valveshutoff device (e.g., the valve shutoff device 100 of FIGS. 1A-1B) isinstalled as a retrofit device on the manual shutoff valve 175 toautomatically shut off the fluid supply based on different criteria suchas, for example and without limitations, detection of seismic waves,receiving a signal (or command) from a client device (e.g., a clientdevice of a person associated with the structure that receive fluid fromthe fluid supply line 170), receiving a signal (or command) from a sever(e.g., a server associated with a government or business entity thatprovide the fluid to the fluid supply line 170 or a server associatedwith emergency responders such as firefighters, civil defense, etc.).

In the example of FIGS. 1A and 1B, the manual shutoff valve 175 includesa shutoff valve actuator 180 that may be turned to close the supply ofthe fluid in the fluid supply line 170. Example of a shutoff valveactuator 180 may include, without limitations, a lever, handle, ahandwheel, etc. In some of the present embodiments, the shutoff valveactuator 180 may rotate by a limited angle (e.g., by 90 degrees from onto off or open to close and vice versa). In these embodiments, amechanical stop may prevent the actuator 180 from turning any further.In some embodiments, the shutoff valve actuator 180 may be free rotatingwithout a mechanical stop. For example, after each turn by 90 degrees,the actuator may turn the manual shutoff valve 175 from a position thatfully closes the fluid supply to a position that fully opens the fluidsupply in the fluid supply line 170.

With reference to FIG. 1B, the valve shutoff device 100 may be installedover the fluid supply line 170 such that the valve coupling key 145 isengaged with the shutoff valve actuator 180. As shown, the valve shutoffdevice 100 is externally installed as a retrofit without a need tocutoff the fluid supply line 170. The valve shutoff device 100 may beinstalled without the need to turn off the fluid supply and/or withoutthe need to cut the fluid supply line 170.

In the example of FIGS. 1A-1B, the shutoff valve actuator 180 is alever. In other embodiments, the shutoff valve actuator 180 may not be alever. For example, a gate valve may have a handwheel to open and closethe valve, or a ball valve may have a handle to open and close thevalve. In these embodiments, the valve shutoff device 100 may havedifferent types of valve coupling keys to match the shutoff mechanism ofthe manual shutoff valve. In some of the present embodiments, the valvecoupling key may be replaceable to allow different types of valvecoupling keys to be connected to the rotor shaft 150 in order to turndifferent shutoff valves actuators. Further examples of different typesof valve coupling keys are described below with reference to FIGS.7A-7C, 9A-9C, and 11A-11C.

With further reference to FIGS. 1A-1B, the rechargeable battery 110 mayprovide power to the motor 115, the limit detector 160, the processingunit 120, the radio transceiver 125, and/or the IMU 135. The solarcell(s) 105 may use solar or ambient light to recharge the rechargeablebattery 110. In some of the present embodiments, in addition to, or inlieu of, the solar cell(s) 105, the rechargeable battery 110 may berechargeable through a wired connection to an electric power outlet suchas, without any limitations, a household electric power outlet. In theseembodiments, the housing 140 may include a socket (not shown) forattaching a power plug to the valve shutoff device 100 to recharge thebattery 110.

The rechargeable battery 110, in some embodiments, may be replaceable.As described below with reference to FIGS. 36-39, some embodiments maydetermine the health status of different components of the valve shutoffdevice 100, including the rechargeable battery 110, and may send one ormore signals to one or more external devices.

The valve shutoff device 100 in some of the present embodiments iscompatible with IoT and performs as an IoT device. The valve shutoffdevice 100 may receive signals and commands from external electronicdevices to turn the fluid supply line's shutoff valve 175 on or offand/or to provide health status and data. The valve shutoff device 100may provide health status and/or data on a pull basis (e.g., afterreceiving a request from an authorized external device) and/or on a pushbasis (e.g., on a periodic basis and/or after an event such as majorseismic activity, a health check failure, a low battery level, etc., isdetected). As described below with reference to FIG. 40, the valveshutoff device 100 may include a set of status lights and/or a displayto provide the health status of different components of the valveshutoff device 100.

The motor 115 may be used to rotate the rotor shaft 150 through thegearbox 155. The motor may include, without any limitations, acontinuous rotation motor or a motor with position control. Examples ofa continuous rotation motor include, without limitations, a motor that,when starts rotating, requires an external signal/command to stop, aservomotor with its internal servomechanism bypassed, etc. Examples of amotor with position control include, without limitations, a servomotorwith internal servomechanism, a stepper (or step) motor, etc. The motorswith position control may receive one or more signals/commands to turn arotor shaft by a specific number of turns or angular degrees and includeinternal circuitry to stop after the rotor shaft is turned by thespecified number of turns or angular degrees.

With continued reference to FIGS. 1A-1B, the processing unit 120 maydetermine whether or not to rotate the rotor shaft 150 to turn theshutoff valve 175 on or off. Examples of the processing unit 120 mayinclude, without any limitations, a microprocessor, a controller, amicrocontroller, a processor (also referred to as a central processingunit or CPU), etc.

The IMU 135 may include one or more sensors. The IMU 135 may include anaccelerometer (e.g., a three-dimensional (3D) accelerometer), amagnetometer (e.g., a 3D magnetometer), and/or a gyroscope (e.g., a 3Dgyroscope) and may measure one or more parameters of mechanical(vibration) waves that may allow the computation of the seismic wavessuch as, without limitations, primary waves (P-waves), secondary waves(S-waves), and surface waves. The seismic waves may be caused, forexample and without limitations, by an earthquake, an explosion, aground movement (e.g., a landslide or an avalanche), etc.

The IMU 135, in some of the present embodiments, may include one or moremicro electro-mechanical system (MEMS) sensors and may be a single chip.In other embodiments, the accelerometer and the magnetometer may be indifferent chips (e.g., different MEMS chips) instead of a single chip.

The IMU 135 may send the measured parameters to the processing unit 120.The processing unit 120 may use the seismic wave parameters and one ormore algorithms to determine the intensity of the seismic waves. If theprocessing unit 120 determines that the intensity of the seismic wavesis above a threshold (e.g., and without any limitations when the seismicwaves are above a threshold that may be caused by an earthquake ofgreater than 5.2-5.4 on Richter scale that many municipalities requirethe gas supply to residential properties to be shutoff), the processingunit 120 may send one or more signals (or commands) to the motor 115 torotate the rotor shaft 150 (e.g., through the gearbox 155) to turn thevalve coupling key 145 that is engaged with the shutoff valve actuator180 (as shown in FIG. 1B) in order to close the shutoff valve 175.

The processing unit 120 may use other criteria to close/turn off/shutoff(or open/turn on) the manual shutoff valve 175. For example, the radiotransceiver 125 may receive one or more signals (or commands) throughthe antenna 130 from an external electronic device such a client deviceor a server to close (or open) the manual shutoff valve 175. The radiotransceiver 125 may send the signal(s)/command(s) to the processing unit120. The processing unit 120, in some of the present embodiments, maydetermine whether the sender of the signal(s)/command(s) is authorizedto request the shutoff valve 175 to be closed (or opened). When theprocessing unit 120 determines that the sender is authorized, theprocessing unit 120 may send one or more signals/commands to the motor115 to rotate the rotor shaft 150.

The limit detector 160 is a sensor that may provide a feedback to theprocessing unit 120 to determine whether the shutoff valve 175 is closed(or opened). The examples of the limit detector may include, without anylimitations, a force or torque sensor external to the motor, a sensorfor measuring the electric current used by the motor, a rotary positionencoder sensor such as an optical or a magnetic position encoder.Servomotors may include an internal servomechanism (or sensor), such asa potentiometer, that may function as a limit detector.

With further reference to FIGS. 1A-1B, the radio transceiver 125 and theantenna 130 may receive data, commands, signals, and/or requests forstatus and data from electronic devices external to the valve shutoffdevice 100 and may pass the received data, commands, signals, and/orrequests for status and data to the processing unit 120. The radiotransceiver 125 and the antenna 130 may receive status and data from theprocessing unit and may transmit them to one or more electronic devicesexternal to the valve shutoff device 100.

The radio transceiver 125 may be a cellular radio transceiver, aBluetooth transceiver, a Bluetooth low energy (BLE) transceiver, an RFIDtransceiver, a Wi-Fi transceiver, etc. Although the example of FIGS.1A-1B shows the processing unit 120, the radio transceiver 125, and theantenna 130 as separate units, in some of the present embodiments, theprocessing unit 120, the radio transceiver 125, and the antenna 130 maybe on a single “system on a chip” integrated circuit (IC). In some ofthe present embodiments, the processing unit 120, the radio transceiver125, the antenna 13, and the IMU (e.g., the accelerometer, themagnetometer, and/or the gyroscope) may be a single “system in package”(SIP). The SIP may include one or more ICs enclosed in a single carrierpackage. One or more of the ICs may include firmware to performcomputationally intensive operations, such as coordinate rotationoperations, using one or more predefined functions.

In some of the present embodiments, the processing unit 120 may receiveand/or store data and health status from different components of thevalve shutoff device 100. For example, and without any limitations, theprocessing unit 120 may receive the current position of the shutoffvalve 180 (e.g., open, close, partially open, etc.), the level ofvoltage generated by the battery 110, the health status of the IMU 135,the health status of the radio transceiver 125, the health status of thelimit detector 160, the health status of the solar cell(s) 105, etc. Theprocessing unit 120 may transmit the data and the health status throughthe radio transceiver 125 to one or more external devices either uponrequest or as a push transfer.

In some of the present embodiments, the valve shutoff device 100 mayinclude a GPS component (not shown). The GPS may be used to determinethe location of the valve shutoff device and may be sent to one or moreelectronic devices, for example, along with the measurements of theseismic activities.

The valve shutoff device 100 may include a housing 140 with a hollowinterior to cover, for example, one or more of the rechargeable battery100, the motor 115, the gearbox 155, the limit detector 160, theprocessing unit 120, the radio transceiver 125, the IMU 135, etc. Thehousing 140 may be weatherproof or weather resistant to protect thecomponents inside. The housing may be made of material such as, withoutany limitations, polyvinyl chloride (PVC), vinyl, plastic, metal, etc.The housing, in some of the present embodiments, may be in the shape ofa pipe or a cylinder. The housing, in some of the present embodiments,may have one or more flat sides, may have an arbitrary shape, etc.

Different embodiments may use different methods to attach/tie the valveshutoff device 100 to the fluid supply line 170 in order to keep thevalve coupling key 145 engaged with the shutoff valve actuator 180. Someembodiments may use one or more clamps to tie the valve shutoff device100 and the fluid supply line 170 together. FIG. 3 is a schematic frontview of a pair of clamps that are used to tie an automatic valve shutoffdevice as a retrofit on a fluid supply line, according to variousaspects of the present disclosure. With reference to FIG. 3, the twoclamps 305 and 310 may be connected together by a threaded rod 315.

Each clamp 305 and 310 may include a threaded section 320 that may getengaged with the threaded rod 315. The distance between the clamps 305and 310 may be adjusted by rotating one or both of the clamps 305 and310 around the threaded rod 315. Each clamp 305 and 310 may have a pairof jaws 330. The open space 350 between the jaws 330 may be adjusted bya pair of bolts 340.

FIG. 4 is a perspective view of an automatic valve shutoff device thatis connected, as a retrofit, by several clamps to a fluid supply line,according to various aspects of the present disclosure. With referenceto FIG. 4, the valve shutoff device 100 may be installed over the fluidsupply line 170 such that the valve coupling key 145 is engaged with theshutoff valve actuator 180.

The threaded rods 315 may be used, as described above with reference toFIG. 3, to adjust the distance between each pair of clamps 305 and 310prior to the installation of the valve shutoff device 100. The bolts 340may be used to adjust the space between the jaws 330 in order to tightenthe grip of the clamps 305 and 310 around the valve shutoff device 100and the fluid supply line 170, respectively.

FIG. 5 is a schematic front view of an automatic valve shutoff devicethat is installed and tied as a retrofit on a fluid supply line,according to various aspects of the present disclosure. With referenceto FIG. 5, the valve shutoff device 100 may be installed over the fluidsupply line 170 such that the valve coupling key 145 is engaged with theshutoff valve actuator 180.

The valve shutoff device 100 may be tied to the fluid supply line 170with one or more straps (e.g., steel or other types of metal cables,metal wires, plastic, nylon, leather, etc.) 521. The strap 521, in someembodiments, may be a cable tie (or a zip tie) with teeth that engageswith a pawl to form a ratchet such that when the free end of the cabletie is pulled, the cable tie tightens and does not come undone. Thestraps 521, in some embodiments, may be a cable or a wire. Some of thepresent embodiments may include one or more compression supports 522between the valve shutoff device 100 and the fluid supply line 170. Thecompression supports 522 in some embodiments are rigid bodies that maykeep the valve shutoff device 100 and the fluid supply line 170separated at a desired distance. In some aspects of the presentembodiments, the compression supports' length may be adjustable.

As shown in the examples of FIGS. 4 and 5, the valve shutoff device 100may be installed as a retrofit without a need to cutoff the fluid supplyline 170. The valve shutoff device 100 may be installed by a consumerwithout the need for a specialist to turn off the fluid supply and/orwithout the need to cut the fluid supply line 170.

In some of the present embodiments, the rotor shaft 150 may have asocket adapter in order to fit into a socket at the base of the valvecoupling key 145. FIG. 6A is a schematic side view of the rotor shaft ofa valve shutoff device, according to various aspects of the presentdisclosure. FIG. 6B is a schematic front view of the rotor shaft of FIG.6A, according to various aspects of the present disclosure.

With reference to FIGS. 6A-6B, the rotor shaft 150 may have a socketadapter 605 at one end in order to fit into a socket of differentreplaceable valve coupling keys as described below with reference toFIGS. 7A-7C, 9A-9C, and 11A-11C. The socket adapter 605 may have aspring action pin 610 to secure the socket adapter 605 into the socketof a valve coupling key.

FIG. 7A is a perspective view of a valve coupling key, according tovarious aspects of the present disclosure. FIG. 7B is a schematic topview of the valve coupling key of FIG. 7A, according to various aspectsof the present disclosure. FIG. 7C is a schematic front view of thevalve coupling key of FIG. 7A, according to various aspects of thepresent disclosure.

With reference to FIGS. 7A-7C, the valve coupling key 145 may includethe coupling heads 701 and 702 that protrude from a base 705. Thecoupling heads 701 and 702 may be made to have different shapes andsizes and the distance between the coupling heads 701 and 702 may beadjusted at manufacture time to match the shutoff valve actuators fordifferent applications. The socket 710 may be used to attach the valvecoupling key 700 to the socket adapter 605 (FIG. 6) at the end of therotor shaft 150.

In the example of FIGS. 7A-7C, the coupling heads 701 and 702 may bedesigned to engage the shutoff valve actuator 180 of FIGS. 1A-1B, and2-5. These examples show that the manual shutoff valve 175 on the fluidsupply line includes a shutoff valve lever to open or close the flow ofthe fluid in the fluid supply line 170. As shown in the examples ofFIGS. 8 and 10, other manual shutoff valves may include other mechanismsfor opening or closing the flow of the fluid in the fluid supply line.

FIG. 8 is a perspective view of a gate valve's handwheel, according toprior art. With reference to FIG. 8, the gate valve handwheel 800includes several spokes 810 that are connected to a hub (or wheel) 820.The hub 820 may be connected to the stem 840. There are several openspaces 830 between the spokes 810. The gate valve handwheel 800 may beused, for example and without any limitations, to open or close the flowof a liquid such as water or petroleum-based liquid in a supply line.

FIG. 9A is a perspective view of a valve coupling key that may be usedto rotate a handwheel of a gate valve, according to various aspects ofthe present disclosure. FIG. 9B is a schematic top view of the valvecoupling key of FIG. 9A, according to various aspects of the presentdisclosure. FIG. 9C is a schematic front view of the valve coupling keyof FIG. 9A, according to various aspects of the present disclosure.

With reference to FIGS. 9A-9C, the valve coupling key 900 may be used toautomatically rotate a handwheel such as the handwheel 800 of FIG. 8.The valve coupling key 900 may, for example, be attached to the rotorshaft 150 of FIGS. 1A-1B, and 2-5, instead of the valve coupling key145, to engage the handwheel 800 of a gate shutoff valve.

With further reference to FIGS. 9A-9C, the valve coupling key 900 mayinclude the coupling heads 901 and 902 that protrude from a base 905.The coupling heads 901 and 902 may be made to have different shapes andsizes and the distance between the coupling heads 901 and 902 may beadjusted at manufacture time to match the open spaces 830 between thespokes 810 of the handwheel 800 of FIG. 8. The valve coupling key 900may have any number of coupling heads 901 (e.g., 1, 2, 3, 4, etc.) tomatch the open spaces between the spokes of different handwheels. Thesocket 910 may be used to attach the valve coupling key 900 to thesocket adapter 605 (FIG. 6) at the end of the rotor shaft 150.

FIG. 10 is a schematic front view of a ball valve that includes a handlefor opening and closing the valve, according to prior art. Withreference to FIG. 10, the ball valve 1000 includes a handle 1305 that isused to rotate the stem 1010 to open or close the flow of fluid in thefluid supply line 170. The handle 1005 may be connected to the stem 1010by a nut 1020.

The stem 1010 is connected to a ball 1040, which has a hole 1050. Thevalve 1000 is open and the fluid may flow in the fluid supply line 170when the ball's hole 1050 is in line with the flow. The valve 1000 isclosed when the handle 1005 is rotated such that the ball's hole is notfacing the flow.

In the example of FIG. 10, the ball's hole is facing the flow and thevalve 1000 is open. The ball valve 1000 is typically open when thehandle is parallel to the fluid supply line 170 (as shown in FIG. 10)and is closed when the handle is perpendicular to the fluid supply line170. The ball valve 1000 may be used, for example and without anylimitations, to open or close the flow of a fluid such as water or gasin a fluid supply line.

FIG. 11A is a perspective view of a valve coupling key that may be usedto rotate the handle of a ball valve, according to various aspects ofthe present disclosure. FIG. 11B is a schematic top view of the valvecoupling key of FIG. 11A, according to various aspects of the presentdisclosure. FIG. 11C is a schematic front view of the valve coupling keyof FIG. 11A, according to various aspects of the present disclosure.

With reference to FIGS. 11A-11C, the valve coupling key 1100 may be usedto automatically rotate the handle 1005 of the ball valve 1000 of FIG.10. The valve coupling key 1100 may, for example, be attached to therotor shaft 150 of FIGS. 1A-1B, and 2-5, instead of the valve couplingkey 145, to engage the handle 1005 of the shutoff valve 1000.

With further reference to FIGS. 11A-11C, the valve coupling key 1100 mayinclude the coupling heads 1101 and 1102 that protrude from a base 1105.The distance between the coupling heads 1101 and 1102 may be adjusted atmanufacture time to match the handle 1005 of a ball valve such as theball valve 1000 of FIG. 10. The socket 1110 may be used to attach thevalve coupling key 1100 to the socket adapter 605 (FIG. 6) at the end ofthe rotor shaft 150.

Different embodiments may use different types of motors, limitdetectors, and/or valve coupling keys to open and close different typesof shutoff valves. Several examples of these components are describedbelow. The invention is, however, not limited to the specificcombination of components described in the following examples.

FIG. 12A is a functional block diagram illustrating an example systemfor an automatic valve shutoff device that includes a force or torquelimit detector, according to various aspects of the present disclosure.With reference to FIG. 12A, the valve shutoff device 100 may be similarto the valve shutoff device 100 of FIGS. 1A and 1B and may include arechargeable battery 110, one or more solar cell(s) 105, a motor 115, aprocessing unit 120, a radio transceiver 125, an antenna 130, an IMU135, a valve coupling key 145, a coupling shaft 150, a gearbox 155, avalve coupling key 145, and a limit detector 1261.

The manual shutoff valve 175 may be similar to the shutoff valve 175 ofFIGS. 1A and 1B and may include a shutoff valve actuator 1281 withmechanical stop. The mechanical stop may prevent the shutoff valveactuator 1281 to freely rotate around a center and may stop the actuatorfrom rotating after a certain numbers (or a certain fraction) of a turn.For example, the mechanical stop may allow the shutoff valve actuator1281 to only make a quarter turn (or 90 degrees) in one direction toopen and to make a quarter turn (or 90 degrees) in the oppositedirection to close.

The rechargeable battery 110 may be recharged, in addition to, or inlieu of, the solar cell(s) 105 from a wired connection (not shown).Although FIG. 12A and several other examples in the present disclosureshows only one rechargeable battery 110, some of the present embodimentsmay include several rechargeable batteries 110. The rechargeable battery110 may provide electrical power (as shown by lines 1255) to differentcomponents of the automatic valve shutoff device 100.

With further reference to FIG. 12A, the processing unit 120 maydetermine whether or not to rotate the rotor shaft 150 to close or openthe shutoff valve 175 based on feedbacks from the IMU 135 and/or basedon one or more signals (or commands) from one or more electronic devices1205 and/or cloud/backend servers 1210. The IMU 135 may measure one ormore parameters of seismic waves such as, without limitations, primarywaves (P-waves), secondary waves (S-waves), and surface waves.

The IMU 135 may send the measured parameters to the processing unit 120.The processing unit 120 may use the seismic wave parameters and one ormore algorithms to determine the intensity of the seismic waves. If theprocessing unit 120 determines that the intensity of the seismic wavesis above a threshold, the processing unit 120 may send one or moresignals (or commands) to the motor 115 to rotate the rotor shaft 150(e.g., through the gearbox 155) to turn the valve coupling key 145 thatis engaged with the shutoff valve actuator 780 in order to close theshutoff valve 175.

The processing unit 120 may receive one or more signals (or commands)through the antenna 130 from one or more electronic devices 1205 and/orone or more cloud/backend servers 1210 to close (or open) the manualshutoff valve 175. The electronic device(s) may be client device(s) ofperson(s) associated with the valve shutoff device 100. The cloud orbackend server(s) 1210 may be computing devices associated with one ormore government agencies and/or utility companies such as, withoutlimitations, firefighting departments, civil defense, unitalitycompanies, gas companies, water companies, etc. The electronic device(s)1205 and the cloud/backend server(s) 130 may communicate with the valveshutoff device 100 through one or more networks 1290 such as theInternet, the cellular network, etc. The processing unit 120 may sendone or more signals (or commands) to the motor 115 to rotate the rotorshaft 150 after the processing unit 120 determines that the requestingelectronic device(s) and/or server(s) has/have authorization to requestthe shutoff valve to be opened or closed.

Regardless of whether the processing unit 120 starts the motor 115 basedon the analysis of seismic waves parameters or in response to receivingsignals or commands from external devices, the processing unit 120 mayneed to know whether the shutoff valve actuator 1281 is stopped by themechanical stop (e.g., after the valve is opened or closed), in order tosend another set of commands (or signals) to the motor 115 to stop. Oneindication that may be used by the processing unit 120 is the amount offorce (or torque) excreted by the motor to the rotor shaft 150. When theshutoff valve actuator 1281 is stopped by the mechanical stop, the force(or torque) excreted by the motor increases. The processing unit 120 maycompare the force (or torque) excreted by the motor with a threshold todetermine whether the shutoff valve actuator 1281 is stopped by themechanical stop and the motor is to be stopped.

The limit detector 1261 in the example of FIG. 12A is a force or torquelimit detector, which may provide measurements of the force (or torque)that is applied to the rotor shaft 150 to the processing unit 120. FIG.13A is a functional diagram showing a force or torque limit detector,according to various aspects of the present disclosure. With referenceto FIG. 13A, the force or torque limit detector 1261 may include a loadcell 1310 (e.g., a torsion load cell) and a signal conditioner 1315. Theload cell 1310 is a transducer that generates an electrical signal 1320with a magnitude that is proportional with a force or torque that isgenerated by the rotor shaft 150.

When the rotor shaft 150 rotates, the shutoff valve actuator withmechanical stop 1281 of FIG. 12A comes to a point where the actuator isstopped by the mechanical stop. At this point, the rotor shaft 150exerts more force (or torque) on the actuator 1281. With reference toFIG. 13A, the load cell measures the force (or torque) generated by therotor shaft 150 and sends the electrical signal 1320 that isproportional to the force (or torque) to the signal conditioner 1315.The signal conditioner 1315 may amplify and/or rectify the electricalsignal 1320 and send the force or torque measurement 1327 as one or moresignals to the processing unit 120. The processing unit 120 may comparethe force or torque measurement with a threshold and may send one ormore signals or commands to the motor 115 to stop the motor 115 when theforce or torque measurements exceed the threshold.

With further reference to FIG. 12A, the processing unit 120 may receiveand/or store data and health status from different components of thevalve shutoff device 100. For example, and without any limitations, theprocessing unit 120 may receive the current position of the shutoffvalve actuator 1281, and therefore, the current position of the shutoffvalve 175 (e.g., open, close, partially open, etc.), the level ofvoltage generated by the battery 110, the health status of the IMU 135,the health status of the radio transceiver 125, the health status of thelimit detector 160, the health status of the solar cell(s) 105, etc.

The processing unit 120 may store the data and/or the health status inthe memory 1250. The processing unit 120 may send the data and/or thehealth status to the radio transceiver 125 to transmit through thenetwork(s) 1290 to one or more of the electronic devices 1205 and/or oneor more cloud/backend servers 130 either upon request or as a pushtransfer. The valve shutoff device 100 may connect to and exchangesignals and data as an IoT device with external electronic devicesthrough the network(s) 1290.

Using the force or torque limit detector 1261 is one way for theprocessing unit 120 to receive feedback to determine whether or not tostop the motor 115. FIG. 12B is a functional block diagram illustratingan example system for an automatic valve shutoff device that includes amotor current limit detector, according to various aspects of thepresent disclosure. FIG. 12B may include similar components as FIG. 12Awith the difference that the valve shutoff device 100 in the example ofFIG. 12B includes a motor current limit detector 1262. The motor currentlimit detector 1262 may provide measurements of the current used by themotor 115.

FIG. 13B is a functional diagram showing a motor current limit detector,according to various aspects of the present disclosure. With referenceto FIG. 13B, the motor current limit detector 1262 may receive andmeasure the motor's current 1325. The motor current limit detector 1262may send the current measurements 1330 to the processing unit 120.

When the rotor shaft 150 rotates, the shutoff valve actuator withmechanical stop 1281 of FIG. 12B comes to a point where the actuator isstopped by the mechanical stop. At this point, the motor 115 may usemore current in order to exerts more force (or torque) on the actuator1281. The processing unit 120 may compare the current measurements 1330with a threshold and may send one or more commands or signals to themotor 115 to stop the motor 115 when the current measurements exceed thethreshold.

FIG. 12C is a functional block diagram illustrating an example systemfor an automatic valve shutoff device that includes a rotary positionencoder limit detector, according to various aspects of the presentdisclosure. With reference to FIG. 12C, the manual shutoff valve 175includes a free rotating shutoff valve actuator 1283, instead of theshutoff valve actuator with mechanical stop 1281 of FIGS. 12A and 12B.The valve shutoff device 100 in the example of FIG. 12C includes arotary position encoder limit detector to determine the angle orrotation and/or the speed of the rotor shaft 150. Other components ofFIG. 12C are similar to the components of FIG. 12A.

The rotary position encoder 1263 may be an optical rotary positionencoder or a magnetic rotary position encoder. FIG. 13C is a perspectiveview of an optical rotary position encoder installed on the rotor shaftof the valve shutoff device, according to various aspects of the presentdisclosure. With reference to FIG. 13C, the optical rotary positionencoder may include a disk 1360 that is installed on the rotor shaft 150(e.g., the rotor shaft 150 of FIG. 12C), several light sources1381-1385, several apertures 1371, and several photo sensors 1361.

The optical rotary position encoder is an electro-mechanical device thatconverts the angular position of the rotation of the rotor shaft 150 toa digitized output signal (e.g., a series of pulses). The encoder's disk1360 includes a group of tracks, which are arranged concentricallyaround the rotor shaft 150. Each track may one or more apertures1380-1391 for allowing light to pass through the disk 1360. Forsimplicity, only a subset of the apertures are shown in FIG. 13C.

In the example of FIG. 13C, the encoder's disk 1360 has five concentrictracks. For example, the aperture 1381 is on the first track, theaperture 1388 is on the second track, the aperture 1389 is on the thirdtrack, the aperture 1386 is on the fourth track, and the aperture 1390is on the fifth track. The number of concentric tracks determines thenumber of output bits generated by the optical rotary position encoder.The optical encoder in the example of FIG. 13C has five concentrictracks and, therefore, generates five bits of output. In otherembodiments, the optical encoder may have fewer or more bits to satisfya desired resolution. For an n bit encoder, the encoder resolution isshown by Equation 1:

$\begin{matrix}\frac{360\mspace{14mu}{degress}}{\left( 2^{n} \right)} & {{Eq}.\mspace{14mu}(1)}\end{matrix}$

The number of light sources 1351-1355, apertures 1371-1375, and photosensors 1361-1365 may be the same as the number of concentric tracks ofthe disk 1360. The light sources 1351-1354 may be, for example andwithout limitations, LED lights. Each light source 1351-1355 may passlight through a corresponding aperture 1371-1375. The light passedthrough each aperture 1371-1375 may be captured by a corresponding photosensor 1361-1365. The light emitted by each light source 1351-1355 mayreach the corresponding aperture 1371-1375 only if it passes through oneof the apertures 1380-1391 on the disk 1360. Otherwise, the emittedlight may be blocked by the opaque portion of the disk 1360 (i.e., theportion that has no aperture 1380-1391). Accordingly, as the disk 1360rotates, the light is either transmitted through or blocked by the disk1360 according to the pattern of the apertures 1380-1391 on the disk1360.

The received light provides an n bit word (in the example of FIG. 13C afive-bit word) that indicates the position of the rotor shaft 150. Theoptical rotary position encoder may include a signal conditioner (notshown) that generates signals (e.g., a series of pluses) to encode then-bit word output of the encoder. The output may be received by theprocessing unit 120. The processing unit may use the encoder's output todetermine whether the shutoff valve is open or close and/or to determinethe current position of the rotor shaft, for example, as described belowwith reference to FIGS. 26-28.

FIG. 13D is a schematic front view of a magnetic rotary position encoderinstalled on the rotor shaft of the valve shutoff device, according tovarious aspects of the present disclosure. With reference to FIG. 13C,the rotor shaft 150 may be similar to the rotor shaft 150 of FIG. 12C.The magnetic rotary position encoder includes a disk 1345, one or moremagnets 1340, and one or more hall effect sensors 1346 and 1347. In theexample of FIG. 13D, only one magnet 1340 and two hall effect sensors0446 and 1347 are shown.

The magnet 1340 has a north pole 1341 and a south pole 1342. Higherprecisions may be achieved by increasing the number of magnetic poles1341-1342 and hall effect sensors 1346-1347. Each hall effect sensormeasures the magnitude of a magnetic field and generates an outputvoltage that is directly proportional to the magnetic field strengthgoing through the sensor. As the rotor shaft 150 rotates, each halleffect sensor 1346-1347 generates a sinusoidal wave 1348-1349,respectively. In the example of FIG. 13D, each sinusoidal wave 1348-1349has a frequency that is equal to the rotational speed of the rotor shaft150.

The hall effect sensor 1347 may be set 90 degrees apart from the halleffect sensor 1346 such that the hall effect sensor 1346 may generate asine wave 1348 and the hall effect sensor 1347 may generate a cosinewave 1349. The sine wave 1348 and the cosine wave 1349 may be used todetermine the direction of rotation of the rotor shaft 150. The sinewave 1348 and the cosine wave 1349 may be interpolated to determine theabsolute position of the rotor shaft 150. The precision of the absoluteposition is increased by increasing the number of the magnetic poles1341-1342 and the number of hall effect sensors 1346-1347.

The magnetic rotary position encoder may include a signal conditioner(not shown) that generates signals to encode the n-bit word output ofthe encoder. The output may be received by the processing unit 120. Theprocessing unit may use the encoder's output to determine whether theshutoff valve is open or close and/or to determine the current positionof the rotor shaft, for example, as described below with reference toFIGS. 26-28.

Although the shutoff valve actuator 1283 is free rotating, the rotaryposition encoder limit detector 1263 may be used to provide feedback tothe motor 115 for turning the shutoff valve actuator with mechanicalstop 1281 of FIGS. 12A-12B. For example, the rotary position encoderlimit detector 1263 may be used to measure that the angular speed of therotor shaft and the processing unit 120 may determine that the shutoffvalve actuator has reached the machinal stop when the angular speed ofthe rotor shaft 150 becomes zero.

Some embodiments may use the seismic waves parameters measured by one ormore sensors such as the IMU 135 (FIGS. 1A-1B and 12A-12C) to identifyand determine the intensity of seismic activities. FIG. 14 is afunctional diagram showing different types of seismic waves, accordingto prior art. With reference to FIG. 14, the seismic waves may includeprimary waves 1421 (or P waves), secondary waves 1422 (or S waves), andsurface waves 1423. The seismic waves 1421-1423 may originate from anepicenter 1450 (e.g., an earthquake epicenter, an explosion epicenter,etc.) and may travel through different parts of Earth to reach astructure 1430.

The simplified view of Earth's structure in FIG. 14 shows the inner core1405, the outer core 1410, the mantle 1415, and the crest 1420. TheP-waves 1421 are the fastest seismic waves and are the first to reach alocation (such as the structure 1430) after a seismic event. The P-waves1421 are mostly compression waves and arrive at a substantially verticalangle when they reach the crust's surface 1425 as opposed to the S-waves1422 and the surface waves 1422 that are substantially shear type wavesthat may arrive in all three dimensions.

The S-waves 1422 start from the epicenter 1450 at the same time as theP-waves 1421 and travel at about half the speed of the primary waves1421. The P-waves 1410 and the S-waves 1422 may travel through theinterior of Earth until they reach the crust's surface 1425. The P-wave1421 and the S-wave 1422 are referred to as body waves.

The surface waves 1423 travel only through the crust 290 and the crest'ssurface 1425. The surface waves 1423 may have lower frequencies than thebody waves 1421-1422 and are the most destructive of the seismic wavesand may make the ground shake side by side or roll up and down.

The surface waves 1423 that move the ground from side to side arereferred to as Love waves (named after the mathematician who firstderived the mathematical model for these waves). The Love waves are thefaster of the two surface waves. The surface waves 1423 that roll theground up or down (similar to waves in an ocean) as well as side by sideare referred to as Rayleigh waves (named after the mathematician whofirst predicted their existence). Most of the shaking caused by seismicactivities are typically caused by Rayleigh waves.

In some of the present embodiments, the processing unit 120 of the valveshutoff device 100 may use an algorithm that distinguishes seismic wavescaused by seismic activities from man-made vibrations and shuts off ashutoff valve on a fluid line when the seismic activities exceed athreshold. The algorithm may include an initial setup and a main loop.

The initial setup may be performed upon installation, power up, and/orreset where the valve shutoff device may be self-calibrated andself-oriented. The valve shutoff device may then enter the main loopthat implements a state machine and moves between one of the followingstates. A no seismic activity state, an alert state, an armed state, andan end state. The state machine remains in the no seismic activity statewhen none of the P, S, or surface waves related to seismic activity isdetected.

The state machine enters the alert state when the P-waves are detectedand there is an expectation of further seismic activities. The statemachine may move from the alert state into the armed state when theS-waves are detected after the P-waves. The state machine may move fromthe armed state into the end state when the magnitude of the seismicactivities exceeds a threshold. The state machine may move from eitherthe alert state or the armed state into the no seismic activity state ifno seismic activities are detected for a threshold time period. In theend state, the valve shutoff device may close the shutoff valve on thefluid supply pipe to prevent a fluid leak in case the pipe rupturesduring seismic activities. Further details of the operations performedfor the identification and determination of the intensity of seismicactivities are described below with reference to FIGS. 17-22.

In order to be able to differentiate the compression-type waves (e.g.,P-waves) from the shear-type waves (e.g., the S or surface waves), thevalve shutoff device may automatically learn/determine the orientationof the coordinate systems during installation, power up, or reset. Insome embodiments, the IMU is in a chip such as a MEMS chip withminiaturized mechanical and electro-mechanical elements. Theaccelerometer of the IMU measures the acceleration parameters and themagnetometer of the IMU measures the magnetic field parameters in acoordinate system that is relative to the orientation of the IMU chip.When the valve shutoff device is installed on a fluid supply line 170(FIG. 1B), the IMU chip may not be in the same orientation as the localcoordinate system.

The valve shutoff device, therefore, requires translating the coordinatesystem used by the IMU into the local coordinate system, for example andwithout any limitations, to identify the local z-coordinate (i.e., thelocal vertical or up and down direction) in order to determine whetherthe parameters measured by the IMU are related to the P-waves 1421 (FIG.14), which are compression waves that arrive substantially in the localvertical direction 1460.

The orientation may be determined by detecting the local verticaldirection, z, by calculating the direction of gravity vector (g) usingthe 3D accelerometer and making the required coordinate transformationto differentiate the z direction from the x-y plane. The local verticaldirection is in opposite direction of the gravity and always has aconstant acceleration of gravity (g=−9.81 meters per square seconds,m/s²) which is reported from three acceleration components, measured bythe accelerometer.

FIGS. 15A and 15B are functional diagrams illustrating the orientationof local coordinates versus the coordinates used by an accelerometer ofa valve shutoff device, according to various aspects of the presentdisclosure. With reference to FIGS. 15A and 15B, the accelerometer maybe a MEMS sensor that is using the coordinates 1505-1515 that aredetermined based on the orientation of a corresponding IC chip. Forexample, if the IC chip is in the shape of a rectangular box, thecoordinates x′ 1515 and y′ 1510 used by the accelerometer may beparallel to the perpendicular sides of one of the box's surfaces and thecoordinate z′ 1505 may be perpendicular to the x′ and y′.

With further reference to FIGS. 15A and 15B, the direction of gravity1540 may be determined from the values of a three dimensionalacceleration vector measured by the accelerometer. For example, thedirection of gravity (which is always up in the local coordinates) maybe determined from one or more values derived from the three dimensionalacceleration vector.

The accelerometer may measure rotational angle “a” 1520 and therotational angle “b” 1530 with respect to the gravity direction, whichis along the local z (or vertical) direction 1540. The angles “a” 1520and “b” 1530 represent the tilting of the IMU's vertical coordinate, z′,with respect the direction of gravity, which is the local verticaldirection, z.

When the IMU 135 (FIGS. 1A-1B), in addition to a 3D accelerometer, isequipped with a 3D magnetometer, the two local horizontal directions xand y (which may not be the same x and y directions used by the IMU) maybe resolved based on the detection of the local magnetic north. FIG. 16is a functional diagram illustrating the rotation between thegeographical north and the magnetic north at an exemplary location wherea valve shutoff device is installed, according to various aspects of thepresent disclosure. With reference to FIG. 16, the magnetometer maydetect the local magnetic north 1620 and determine the amount ofmagnetic north rotation 1640 with respect to the geographical north1625.

The IMU's 3D magnetometer may measure the three components of magneticfield vector and may determine the magnetic north direction as thedirection of the highest field. Since the magnetic north rotation 1640is typically a small amount, some of the present embodiments may set thegeographical north 1625 direction to the magnetic north direction 1620.

As discussed above, in some of the present embodiments, the processingunit 120 and the IMU 135 may be in a SIP. In some of these embodiments,the SIP may include firmware and/or software that implements a motionengine. The motion engine may include digital signal processing firmwareor software that may receive raw motion data from the MEMS sensors(e.g., the accelerometer and/or the magnetometer) and may translate theraw data into motion information.

For example, and without limitations, some of the present embodimentsmay use a SIP such as BNO080 or BNO085 SIP developed by Hillcrest Labs.The BNO080 or BNO085 SIPs include a firmware “motion engine”, which mayperform coordinate rotation operations. For example, the BNO080 orBNO085 SIPs may include a “tare” function that uses quaternionmathematics to perform coordinate rotation from the IMU's frame ofreference (x′, y′, z′) to the local coordinate (x, y, z). This function,which may be invoked by the processing unit, may remove the burden ofcomputational resources from the processing unit by performing thecomputations with firmware. The quaternion is a number system thatextends the complex numbers. Quaternions are represented in the form ofa+bi+cj+d k, where a, b, c, and d are real numbers and i, j, and k arethe symbols that can be interpreted as unit-vectors pointing along thethree spatial axes. The “taring” allows the SIP to be mounted in thevalve shutoff device 100 in an arbitrary manner and invoking the tarefunction may determine the orientation that needs to be applied to theoutputs to align with the local coordinates (e.g., up, north, east)frame of reference. This orientation may then be applied to all motionoutputs.

In the example of FIG. 16, the local horizontal plane 1605 isperpendicular to the local z direction (or the opposite direction ofgravity). The local x coordinate 1610 is in the local horizontal plane1605 and, in this example, is set along the geographical north 1625. Inthe embodiments that set the magnetic north rotation 1640 to 0, thelocal x coordinate 1610 is set along the magnetic north direction 1620.

The local y coordinate 1615 is set in the local horizontal plane 1605 at90 degrees to the local x coordinate 1610. The horizontal x 1610 and y1615 directions, in some embodiments, may be used in reporting orrecording the direction of propagation of incoming seismic waves andreporting the direction to the cloud/backend server(s) 1210 (FIGS.12A-12C) to help in global studies and analysis.

Details of the operations performed for the identification anddetermination of the intensity of seismic activities are described belowwith reference to FIGS. 17-22. As described below, one of the keyfeatures of the algorithm to determine whether the shutoff valve is tobe closed due to seismic activities is avoiding false-positive triggers,without unnecessarily increasing the threshold used for the detection ofthe surface waves 1423 (FIG. 14), which are the most destructive of theseismic waves.

The algorithm may identify and distinguish various components of seismicactivities in order to eliminate false positives and to close the valvewhen the intensity of the seismic waves exceed a threshold. Thealgorithm attempts to differentiate between seismic waves and man-madevibratory noises, such as without any limitations, a sudden jerk (e.g.,an object, like a ball or a toy, accidentally hitting the valve shutoffdevice and/or the associated pipes), vibrations (e.g., a truck movingnear the valve shutoff device), or bursty vibrations (e.g., a jackhammeroperating in the neighborhood, and thus vibrating the ground and thepipes).

This differentiation, in some of the present embodiments, may be madebased on the known features of the seismic waves such as the frequencycontent (spectrum), the duration and the shape of the wave envelope(much like the amplitude modulation (AM) wave detection in radiocommunication systems), or calculating a “power” ratio of variousvibration components.

FIG. 17 is a flowchart illustrating an example process 1700 forperforming an initial setup for identification and determination of theintensity of seismic activities, according to various aspects of thepresent disclosure. The process 1700, in some of the presentembodiments, may be performed by the processing unit 120 (FIGS. 12A-12C)and/or by firmware of a valve shutoff device 100 during installation,power up, and/or reset of the valve shutoff device 100.

With reference to FIG. 17, the subsystems of the IMU may beself-calibrated (at block 1710) as needed. For example, the IMU MEMSchip in some embodiments may have built-in self-calibration. In theseembodiments, the processing unit 120 may send a signal to the IMU 125 toperform self-calibration.

Next, a rotational coordinate transformation may be made (at block 1710)from the (x′, y′, z′) coordinates used by the IMU to the localcoordinates (x, y, z). The x and y may be in the two local horizontaldirections 1610 and 1615 (FIG. 16) (e.g., east-west and north-southdirections) and z may be in the local vertical direction (e.g.,direction of the local zenith). The coordinate transformation matrixparameters may be computed and stored (at block 1715). The processingmay then proceed to the “no seismic activity” state, which is describedbelow with reference to FIG. 19.

The specific operations of the process 1700 may not be performed in theexact order shown and described. Furthermore, the specific operationsdescribed with reference to FIG. 17 may not be performed in onecontinuous series of operations in some embodiments, and differentspecific operations may be performed in different embodiments. Forexample, in some aspects of the present embodiments, the rotationalcoordinate transformation from the (x′, y′, z′) coordinates used by theIMU to the local coordinates (x, y, z) may be made (at block 1710) byperforming a process such as process 1800 described below with referenceto FIG. 18.

In other embodiments, the rotational coordinate transformation from the(x′, y′, z′) coordinates used by the IMU to the local coordinates (x, y,z) may be made (at block 1710), for example and without any limitations,by the processing unit and/or by firmware by performing a predefinedfunction of a motion engine such as the tare function described above.In some aspects of the present embodiments, the coordinatetransformation matrix parameters may be computed and stored (at block1715) by the processing unit 120 and/or by firmware.

FIG. 18 is a flowchart illustrating an example process 1800 forperforming the rotational coordinate transformation from the (x′, y′,z′) coordinates used by the IMU to the local coordinates (x, y, z),according to various aspects of the present disclosure. The process1800, in some of the present embodiments, may be performed by theprocessing unit 120 (FIGS. 12A-12C) and/or by firmware of a valveshutoff device 100 during installation, power up, and/or reset of thevalve shutoff device 100. Process 1800, in some of the presentembodiments, provides details of block 1710 of FIG. 17.

With reference to FIG. 18, the number of the IMU's orientation readingsused for getting an average orientation reading may be set (at block1805). The number of the IMU's orientation readings is denoted as N inthe following equations. This number, which may be an integer greater orequal to 1, may be a predetermined value, may be set during theprovisioning of the valve shutoff device (e.g., through the clientdevice 2535 of FIGS. 25, 31, and 39), or may be provided by thecloud/backend servers 1210 (FIGS. 12A-12C and 36) over the network(s)1290.

In some embodiments, any other constants used by the processes of FIGS.18-22 may be a predetermined value, may be set during the provisioningof the valve shutoff device, or may be provided by the cloud/backendservers 1210. Some of the present embodiments may not get an average oforientation readings. In these embodiments, the value of N is set to 1.With reference to FIG. 18, a loop with N iterations may be performedthrough blocks 1810-1830.

The three components of the acceleration vector (A_(x)′, A_(y)′, A_(z)′)may be received (at block 1810) from the IMU's accelerometer, expressedin the IMU's coordinate system (x′, y′, z′). The direction of gravitymay be determined (at block 1815) using the acceleration vector'sparameters. For example, the direction of gravity may be determined asdescribed above with reference to FIGS. 15A-15B.

Next, the measurements of the magnetic field may be received (at block1820) from the IMU's magnetometer. The orientation of the magnetic northmay be determined (at block 1825) from the parameters measured by IMU'smagnetometer. For example, the orientation of magnetic north may bedetermined as described above with reference to FIG. 16. Next, adetermination may be made (at block 1830) whether all N IMU's readingsare received. If not, the processing may proceed to block 1810, whichwas described above.

Otherwise, an average for each component of the acceleration vector(Ax′, Ay′, Az′) and an average for the orientation of the magnetic northmay be calculated (at block 1835), for example to improve the accuracyof data. In the embodiments that N is set to 1, the blocks 1830 and 1835may be skipped. Next, a rotational coordinate transformation may be made(at block 1840) from the (x′, y′, z′) coordinates used by the IMU to thelocal coordinates (x, y, z). The x and y may be in the two localhorizontal directions 1610 and 1615 (FIG. 16) (e.g., east-west andnorth-south directions) and z may be in the local vertical direction(e.g., direction of the local zenith). The processing may then end.

FIG. 19 is a flowchart illustrating an example process 1900 foridentifying P-waves related to seismic activities, according to variousaspects of the present disclosure. The process 1900, in some of thepresent embodiments, may be performed by the processing unit 120 (FIGS.12A-12C) and/or the firmware of a valve shutoff device 100.

With reference to FIG. 19, the constants, variables, timers andvariables used for the identification and determination of the intensityof seismic activities may be initialized (at block 1905). The followingsare an exemplary list of the constants, variables, and timers that maybe used in some of the present embodiments.

-   -   N1: The number of samples (or time) used for discrete Fourier        transformation (DFT)    -   RT: The threshold value for the ratio of the power of P-wave        (the vertical component of the acceleration vector) to the total        power of all components of the acceleration vector    -   Tp: The minimum duration threshold of the P-wave activity    -   Tp-s: The minimum quiet period between P and S waves    -   Ts: The minimum expected duration of the S wave activity    -   T3: The time threshold for the surface waves magnitude for        executing the shutoff procedure    -   N2: The number of samples for measuring the P-waves power ratio    -   N3: The number of samples for measuring the S-waves power    -   N4: The number of samples for measuring the surface waves power    -   M1: The low activity threshold    -   M2: The magnitude threshold for the armed state    -   M3: The shut-off magnitude threshold    -   Lt: The loop timer    -   Tout-1: The timeout value for detecting the S-waves    -   Tout-2: The timeout value for detecting the surface waves

With further reference to FIG. 19, the three components of theacceleration vector in the local coordinates may be determined (at block1915). In some of the present embodiments, the three components of theacceleration vector in the local coordinates may be computed by firmware(e.g., the firmware associated with a motion engine). For example, thefirmware may perform a coordinate rotations from the (x′, y′, z′)coordinates used by the IMU to the local coordinates (x, y, z). Thegravity may in some embodiments be subtracted from the z accelerationcomponents.

In other embodiments, the processing unit 120 may compute he threecomponents of the acceleration vector in the local coordinates. Forexample, the processing unit 120 may the three components of theacceleration vector (A_(x)′, A_(y)′, A_(z)′) may be received (at block1915) from the IMU's accelerometer. The processing unit 120 may performa coordinate rotation (transformation) to compute the accelerationvector relative to the local coordinate system (x, y, z). The coordinaterotation (transformation) may be performed by using the parametersreceived in the initial setup state (FIG. 17) for identifying thedirections of gravidity and the local magnetic north. The processingunit 120 may subtract gravity from the z acceleration components.

At block 1920, discrete Fourier transform may be performed on the threecomponents of the acceleration vector, A(t)={A_(x)(t), A_(y)(t),A_(z)(t)} over N1 samples in order to obtain the spectral components,A″(ω)={A″_(x)(ω), A″_(y)(ω), A″_(z)(ω)} of the acceleration vector. Forexample, some embodiments may perform a fast Fourier transform (FFT)algorithm to compute the discrete Fourier transform of the components ofthe acceleration vector, A″(ω). In order to distinguish seismic wavesfrom man-made vibrations, some embodiments may filter the parametersreceived from the IMU to limit the data to the frequencies of theseismic waves. Performing the DFT (or FFT) converts the normalized(re-oriented) IMU measurements to a function of frequency, allowing themeasurements to be filtered by their frequencies as described below.

Next, the results of the DFT is filtered (at block 1925) to limit thethree components of the acceleration vector to the range of frequenciesof the P-waves. In some of the present embodiments, the three componentsof the acceleration vector may be filtered to components withfrequencies in the range of frequencies of the P-waves to eliminate thecomponents (e.g., the components caused by man-made activities) that arenot related to the P-waves. Eliminating these components are similar toapplying a band pass filter in the range of frequencies of the P-wavesto the parameters received from the IMU. The band limited accelerationvector, as a function of time, is referred herein as A″(t)={A″_(x)(t),A″_(y)(t), A″_(z)(t)}.

Next, the relative power of the P-waves to the power of all componentsof the acceleration vector may be computed (at block 1930). Since theP-waves are mostly compression waves and propagate from below thesurface of the earth, the P-waves arrive substantially in the verticaldirection. The P-waves may, therefore, be identified by analyzing thevertical component of the acceleration vector, i.e., the z component,A″_(z)(t), of the band-limited acceleration vector, A″(t) with respectto the local coordinate system.

The relative power of the P-waves, in some embodiments, may be computedas the ratio, R_(p), of the magnitude of the envelope of the normalized(and band-limited) vertical component of the acceleration to thenormalized horizontal component. In other embodiments, the ratio of themagnitude of power (under the curve) of the vertical component to thetotal seismic vector power magnitude (A″²) is computed as shown inEquation (2) and the result is compared with the threshold value R_(T).When the P-waves arrive, the ratio of the vertical power to the totalpower increases above a threshold value and may then slowly decrease.

The relative strength of the P-wave to the total vector power ratio isgiven in Equation (2):

$\begin{matrix}{R_{p} = \frac{\sum\limits_{t = 1}^{N_{1}}{A_{z}^{''2}(t)}}{\sum\limits_{t = 1}^{N_{1}}\left( {{A_{x}^{''2}(t)} + {A_{y}^{''2}(y)} + {A_{z}^{''2}(t)}} \right)}} & {{Eq}.\mspace{14mu}(2)}\end{matrix}$

where, A″_(x)(t), A″_(y)(t), A″_(z)(t) are instantaneous accelerationcomponents along each local coordinate axes after filtering, and R_(P)is the ratio of the vertical vibrations' power to the total vibrations'power in the three directions.

With further reference to FIG. 19, a determination may be made (at block1935) whether the relative strength of the P-wave to the total vectorpower ratio is greater than or equal to a threshold, R_(T). If not, theP-waves are not detected and the processing may proceed to block 1905,which was described above.

Otherwise, a determination may be made (at block 1940) whether theP-waves bursts have lasted for a time period, T_(p). The valve of R_(p)may be monitored and if for a period t>=T_(p), the value is greater thanor equal to the threshold, R_(T), the processing may proceed to block1945, which is described below. Otherwise, the P-waves are not detectedand the processing may proceed to block 1905, which was described above.In some embodiments, the determination of whether the P-waves burstshave lasted for a time period is optional. These embodiments may skipblock 1940.

At block 1945, the total wave activity power magnitude over an N₂ samplewindow may be computed as shown by Equation (3):M=Σ _(t=1) ^(N)2(A″ _(x) ²(t)+A″ _(y) ²(t)+A″ _(z) ²(t))  Eq. (3)

Since the P-waves travel faster than the S-waves, the detection of theP-waves may be followed by a period of relatively low activity, T_(p-s).At block 1950, a determination may be made whether M is less than thethreshold M₁ for a time period t>=T_(p-s). If not, the P-waves are notdetected and the processing may proceed to block 1905, which wasdescribed above. Otherwise, the detection of the P-waves is conformedand the processing may proceed to the alert state, which is describedbelow with reference to FIG. 20.

When the epicenter of the seismic waves is close to where the valveshutoff device is installed, the S-waves may arrive in a relativelyshort time period after the P-waves. In some of the present embodiments,the valve of T_(p-s) may be set to a small value (e.g., less than 5seconds, less then 1 second, less than a fraction of a second, etc.) toaccount for the situations where the epicenter may be close to thelocation of the valve shutoff device. Some of the present embodimentsmay set the T_(p-s) to 0. These embodiments may skip blocks 1945 and1950.

Some of the present embodiments may close the shutoff valve afterdetecting the P-waves and without waiting for the S-waves or surfacewaves to be detected. In these embodiments, after the P-waves aredetected, the processing may proceed to the end state (instead of thealert state), described below with reference to FIG. 22, to close theshutoff valve.

FIG. 20 is a flowchart illustrating an example process 2000 foridentifying the S-waves related to seismic activities, according tovarious aspects of the present disclosure. The process 2000, in some ofthe present embodiments, may be performed by the processing unit 120(FIGS. 12A-12C) and/or the firmware of a valve shutoff device 100.

With reference to FIG. 20, a timer, Lt, may be started (at block 2005)for detecting S-waves. Next, the three components of the accelerationvector in the local coordinates may be determined (at block 2015). Insome of the present embodiments, the three components of theacceleration vector in the local coordinates may be computed by firmware(e.g., the firmware associated with a motion engine). For example, thefirmware may perform a coordinate rotations from the (x′, y′, z′)coordinates used by the IMU to the local coordinates (x, y, z). Thegravity may in some embodiments be subtracted from the z accelerationcomponents.

In other embodiments, the processing unit 120 may compute he threecomponents of the acceleration vector in the local coordinates. Forexample, the processing unit 120 may the three components of theacceleration vector (A_(x)′, A_(y)′, A_(z)′) may be received (at block2015) from the IMU's accelerometer. The processing unit 120 may performa coordinate rotation (transformation) to compute the accelerationvector relative to the local coordinate system (x, y, z). The coordinaterotation (transformation) may be performed by using the parametersreceived in the initial setup state (FIG. 17) for identifying thedirections of gravidity and the local magnetic north. The processingunit 120 may subtract gravity from the z acceleration components.

At block 2020, discrete Fourier transform may be used on the threecomponents of the acceleration vector, A (t)={A_(x)(t), A_(y)(t),A_(z)(t)} over N3 samples to obtain A″(ω)={A″_(x)(ω), A″_(y)(ω),A″_(z)(ω)}. For example, some embodiments may perform a fast Fouriertransform (FFT) algorithm to compute the discrete Fourier transform ofthe components of the acceleration vector, A (t).

Next, the results of the DFT may be filtered (at block 2025) toband-limit the three components of the acceleration vector, A″(ω), tothe range of frequencies of the seismic waves. For example, the threecomponents of the acceleration vector, A (t), may be filtered tocomponents with frequencies of the seismic waves to eliminate thecomponents (e.g., the components caused by man-made activities) that arenot related to the seismic waves. Eliminating these components aresimilar to applying a band pass filter in the range of the seismic wavesto the parameters received from the IMU after coordinate transformationfrom the IMU's coordinates into the local coordinates (e.g., byperforming a “taring” function as described above). The band-limitedacceleration vector, in time-domain, is referred herein asA″(t)={A″_(x)(t), A″_(y)(t), A″_(z)(t)}. During the alert state, therange of frequencies that are considered may be different than the rangeof frequencies considered for the detection of the P-waves during the“no seismic activity” state.

With further reference to FIG. 20, the total wave activity powermagnitude over an N₃ sample window may be computed (at block 2030) asshown in Equation (4):M _(S)=Σ_(t=1) ^(N3)(A″ _(x) ²(t)+A″ _(y) ²(t)+A″ _(z) ²(t))  Eq. (4)

where, A″_(x)(t), A″_(y)(t), A″_(z)(t) are the instantaneousband-limited acceleration components along each local coordinate axes.Since the S-waves may have any polarization, Equation (4) computes thetotal vector magnitude (power) of the seismic waves.

Next, a determination may be made (at block 2035) whether the total waveactivity power magnitude over an N₃ sample window exceeds a threshold,M₂. If yes, S-waves are detected and the processing may proceed to thearmed state, which is described below with reference to FIG. 21.Otherwise, a determination may be made (at block 2040) whether the timerLt has exceeded a threshold, Tout-1. If not, the processing may proceedto block 2010, which was described above. Otherwise, the time period forexpecting the S-waves is expired and the processing may proceed to the“no seismic activity” state, which was described with reference to FIG.17.

Some of the present embodiments may close the shutoff valve afterdetecting the S-waves and without waiting for the surface waves to bedetected. In these embodiments, when the determination is made (at block2035) that the total wave activity power magnitude over an N₃ samplewindow exceeds a threshold, M₂ (i.e., when the S-waves are detected),the processing may proceed to the end state (instead of the armedstate), described below with reference to FIG. 22, to close the shutoffvalve.

FIG. 21 is a flowchart illustrating an example process 2100 foridentifying the surface waves related to seismic activities, accordingto various aspects of the present disclosure. The process 2100, in someof the present embodiments, may be performed by the processing unit 120(FIGS. 12A-12C) and/or the firmware of a valve shutoff device 100.

With reference to FIG. 21, a timer, Lt, may be started (at block 2105)for detecting the surface waves. As described above with reference toFIG. 14, the surface waves 1423 may include the Love waves and theRayleigh waves.

Next, the three components of the acceleration vector in the localcoordinates may be determined (at block 2115). In some of the presentembodiments, the three components of the acceleration vector in thelocal coordinates may be computed by firmware (e.g., the firmwareassociated with a motion engine). For example, the firmware may performa coordinate rotations from the (x′, y′, z′) coordinates used by the IMUto the local coordinates (x, y, z). The gravity may in some embodimentsbe subtracted from the z acceleration components.

In other embodiments, the processing unit 120 may compute he threecomponents of the acceleration vector in the local coordinates. Forexample, the processing unit 120 may the three components of theacceleration vector (A_(x)′, A_(y)′, A_(z)′) may be received (at block2115) from the IMU's accelerometer. The processing unit 120 may performa coordinate rotation (transformation) to compute the accelerationvector relative to the local coordinate system (x, y, z). The coordinaterotation (transformation) may be performed by using the parametersreceived in the initial setup state (FIG. 17) for identifying thedirections of gravidity and the local magnetic north. The processingunit 120 may subtract gravity from the z acceleration components.

At block 2120, discrete Fourier transform may be used on the threecomponents of the acceleration vector, A (t)={A_(x)(t), A_(y)(t),A_(z)(t)} over N4 samples to obtain the frequency-domain vector A(ω)={A_(x)(ω), A_(y)(ω), A_(z)(ω)}. For example, some embodiments mayperform a fast Fourier transform (FFT) algorithm to compute the discreteFourier transform of the components of the acceleration vector, A″(ω).

Next, the results of the DFT may be filtered (at block 2125) toband-limit the three components of the acceleration vector, A″(t), tothe range of frequencies of the seismic waves. The three components ofthe acceleration vector, A (t), may be filtered to components in therange of frequencies of the seismic waves to eliminate the componentsthat are not related to the seismic waves (e.g., the components causedby man-made activities). Eliminating these components are similar toapplying a band pass filter in the range of frequencies of the seismicwaves to the parameters received from the IMU. The band-limitedacceleration vector is referred herein as A″(t)={A″_(x)(t), A″_(y)(t),A″_(z)(t)}. In some of the present embodiments, the range of frequenciesthat are considered during the armed state may be similar to the rangeof frequencies considered during the alert state, which may be widerthan the range of frequencies considered for the detection of theP-waves during the “no seismic activity” state.

With further reference to FIG. 21, the total wave activity powermagnitude over an N₄ sample window may be computed (at block 2130) asshown in Equation (5):M _(sur)Σ_(t=1) ^(N)4(A″ _(x) ²(t)+A″ _(y) ²(t)+A″ _(z) ²(t))  Eq. (5)

where, A″_(x)(t), A″_(y)(t), A″z(t) are instantaneous band-limitedacceleration components along each local coordinate axes. Equation (5)in some embodiments is similar to Equation (4) used for detecting theS-waves.

Next, a determination may be made (at block 2135) whether the total waveactivity power magnitude over an N₄ sample window, Msur, exceeds athreshold, M₃ over a time period t greater than a threshold, T3. In thearmed state, the Love and Rayleigh seismic activity components areexpected. These waves are characterized by high intensity accelerationin all three directions. Therefore, the magnitude of the accelerationvector may be used to identify an occurrence of a severe earthquake andits severity or intensity. The threshold M₃ may be higher than thethreshold M₂ used above for detecting the S-waves.

When the total wave activity power magnitude over an N₄ sample window,Msur, is determined (at block 2135) to exceed the threshold, M₃ over thetime period t greater than a threshold, T3, the surface waves aredetected and the processing may proceed to the end state, which isdescribed below with reference to FIG. 22. Otherwise, a determinationmay be made (at block 2140) whether the timer Lt has exceeded athreshold, Tout-2. If not, the processing may proceed to block 2110,which was described above. Otherwise, the time period for expecting thesurface waves is expired and the processing may proceed to the “noseismic activity” state, which was described with reference to FIG. 17.

FIG. 22 is a flowchart illustrating an example process 2200 for closinga shutoff valve on a fluid supply line after the surface waves relatedto seismic activities exceed a threshold, according to various aspectsof the present disclosure. The process 2200, in some of the presentembodiments, may be performed by the processing unit 120 (FIGS. 12A-12C)of a valve shutoff device 100.

With reference to FIG. 22, the shutoff valve on the fluid supply linemay be closed (at block 2205). For example, the processing unit 120(FIG. 1B) may send a signal to the motor 115 to turn the rotor shaft 150and the valve coupling key 145 in order to turn the shutoff valveactuator 180 and close the shutoff valve 175. Several examples ofprocesses for closing the shutoff valve are described below withreference to FIGS. 23-24 and 27-28.

With further reference to FIG. 22, one or more data items related to theseismic activities may be sent (at block 2210) to one or more electronicdevices. The examples of the data items sent to the one or moreelectronic devices may include without limitations, the status of theshutoff valve (e.g., open or close), the parameters received from theaccelerometer, the parameters received from the magnetometer, thecalculations related to the power and/or the duration of the P-waves,the calculations related to the power and/or the duration of theS-waves, the calculations related to the power and/or the duration ofthe surface waves, the time period between the detection of the P-wavesand S-waves, the time period between the detection of the S-waves andsurface-waves, the location of the valve shutoff device, etc.

The data items may be sent by the processing unit 120 (FIGS. 12A-12C)through the radio transceiver 125, the antenna 135, and the network(s)1280 one or more of the electronic devices 1205 and/or one or more ofthe cloud/backend servers 1210. The processing may then end. In some ofthe present embodiments, the valve shutoff device may include a globalpositioning system (GPS) chip. In these embodiments, the location of thevalve shutoff device may be determined through the GPS.

In some of the present embodiments, the location of the shutoff valve(e.g., a physical address and/or the geographic coordinates (e.g., thelongitude and the latitude) of the location where the shutoff valve isinstalled may be entered through a client device 2535 (FIG. 25) duringthe provisioning of the valve shutoff device. Some of the presentembodiments may not send any data. These embodiments may skip block2210.

FIG. 23 is a flowchart illustrating an example process 2300 for turningoff a shutoff valve that has a mechanical stop, by a continuous rotationmotor, according to various aspects of the present disclosure. Acontinuous rotation motor may be a motor without a feedback loop. Thecontinuous rotation motor may be a motor that lacks a feedback loop ormay be a servomotor that is modified to offer open-loop position controlinstead of the usual closed-loop position control. A continuous rotationmotor may need to receive a set of one or more signals to start rotatingand another set of one or more signals to stop rotating. In some of thepresent embodiments, the process 2300 may be performed by the processingunit 120 (FIGS. 1A-1B and 12A-12C).

With reference to FIG. 23, one or more signals comprising seismic wavesparameters may be received (at block 2305) from an IMU. For example, theprocessing unit 120 (FIG. 12A) may receive one or more parametersrelated to seismic waves 1421-1423 of FIG. 14 from the IMU 135.

With further reference to FIG. 23, the signals 2310 may be analyzed (atblock 2310) to determine, based on one or more criteria, whether to turnoff a shutoff valve on a fluid supply line. For example, the processingunit 120 (FIG. 12A) may analyze the seismic waves parameters asdescribed above with reference to FIGS. 17-22 to determine whether theseismic activities are above a threshold (e.g., a threshold to ensurethe seismic activities, when translated into the Richter scale, areabove a predetermined limit such as for example and without limitations,5.2 level, 5.3 level, 5.4 level, etc.)

Next, a determination may be made (at block 2315) whether to turn offthe shutoff valve. For example, the processing unit 120 may determinewhether to turn off the shutoff valve based on the analysis. The detailsof blocks 2305-2315 were described above with reference to FIGS. 17-22.When it is determined (at block 2315) that the shutoff value is not tobe turned off, the processing may return to block 2305, which wasdescribed above. Otherwise, one or more signals may be sent (at block2320) to the continuous rotation motor to start rotating the rotor shaftto turn off the shutoff valve. For example, the processing unit 120 maysend a signal to the motor 150 (FIGS. 1A-1B and 12A-12C) to startrotating the rotor shaft 150 to turn off the shutoff valve 175.

At block 2325, one or more parameters from a limit detector may bereceived. Since the motor in the example of process 2300 is a continuousrotation motor and the shutoff valve actuator 1281 has a mechanicalstop, the processing unit 120 has to know when the shutoff valveactuator is no longer rotating in order to turn off the motor.

The limit detector, in some of the present embodiments, may be a forceor torque limit detector 1261 (FIGS. 12A and 13A) and the parametersreceived from the limit detector 1261 may include measurements of forceand/or torque exerted on the rotor shaft 150. The limit detector in someembodiments may be a motor current limit detector 1262 (FIGS. 12B and13B) and the parameters received from the limit detector 1262 mayinclude measurements of electrical current used by the motor 115. Thelimit detector in some embodiments may be a rotary position encoder 1263such as the optical rotary position encoder of FIG. 13C or the magneticrotary position encoder of FIG. 13D and the measurements may include theposition and/or the speed of the rotor shaft 150.

With further reference to FIG. 23, the parameters received from thelimit detector may be analyzed (at block 2330) to determine whether theshutoff valve actuator has reached the mechanical stop. For example, ifthe limit detector is a force or torque limit detector, the processingunit 120 may determine whether the force or torque exerted on the rotorshaft 150 has exceeded a limit. If the limit detector is a motor currentlimit detector, the processing unit 120 may determine that the currentused by the motor 115 has exceeded a limit. If the limit detector is arotary encoder, the processing unit 120 may determine that therotational speed of the rotor shaft 150 has reached zero and/or whetherthe angular position of the rotor shaft 150 has reached a predeterminedangle.

At block 2335, a determination may be made whether the shutoff valveactuator has reached the target limit (e.g., a mechanical stop). If not,the processing may proceed to block 2325, which was described above.Otherwise, one or more signals may be sent (at block 2340) to thecontinuous rotation motor to stop rotating the shaft. The processing maythen end.

FIG. 24 is a flowchart illustrating an example process 2400 for turningoff a shutoff valve, which has a mechanical stop, by a motor that hasposition control, according to various aspects of the presentdisclosure. In some of the present embodiments, the process 2400 may beperformed by the processing unit 120 (FIGS. 12A-12C).

A motor with position control may be a servomotor that is a motor with afeedback circuitry, for example, and without any limitations, apotentiometer, and a control circuit. As the servomotor rotates, thepotentiometer's resistance may change and the control circuit mayprecisely control how much movement is made by the servomotor and inwhich direction. The processing unit 120 of the automatic valve shutoffdevice 100 may send one or more signals and/or commands to the controlcircuit of the servomotor to rotate the rotor shaft 150 by a certainamount.

A motor with position control may be a stepper motor (or step motor). Astepper motor divides a full rotation into a number of equal steps. Themotor's position may then be controlled by sending signals to the motorto move and hold at one of these steps.

With reference to FIG. 24, blocks 2405-2415 are similar to blocks2305-2315 of FIG. 23, respectively. The details of blocks 2305-2315 and2405-2415 were described above with reference to FIGS. 17-22. At block2420, one or more signals may be sent to the motor that has positioncontrol to rotate the rotor shaft by a predetermined number of degrees(or number of turns). For example, the processing unit 120 may send asignal or command to the motor 115 to turn the rotor shaft 150 by anumber of degrees. The rotor shaft 150 may be connected to the valvecoupling key 145, which in turn may be engaged with the shutoff valvelevel 180.

The shutoff valve actuator 180 may, for example, be the shutoff valvelever 180 (FIG. 2) or the ball valve handle 1005 (FIG. 10) thattypically turns 90 degrees from open to close. The processing unit maynot know whether the shutoff valve is currently open, closed, orpartially closed. The shutoff valve actuator 180 may, for example, bethe gate valve handwheel 800 (FIG. 8) that may need to be turned aroundseveral times in order to be closed. The processing unit may not knowthe current position of the handwheel and/or how many turns thehandwheel 800 has be turned to close. The processing unit may,therefore, send one or more signals or commands to the motor (at block2420) to turn the rotor shaft 150 in a direction that closes the valveand check one or more parameters to make sure the shutoff valve actuator180, the handle 1005, or the handwheel 800 have reached the mechanicalstop and the valve is closed.

With further reference to FIG. 24, one or more measurements may bereceived (at block 2425) from a limit detector. The limit detector maybe one of the limit detectors described above with reference to block2325 of FIG. 23. The limit detector may be external to or an integralpart of the servomotor. For example, the limit detector may be apotentiometer that is integral to the motor.

With continued reference to FIG. 24, the parameters received from thelimit detector may be analyzed (at block 2430) to determine whether theshutoff valve actuator has reached the mechanical stop. For example, ifthe limit detector is a force or torque limit detector, the processingunit 120 may determine whether the force or torque exerted on the rotorshaft 150 has exceeded a limit. If the limit detector is a motor currentlimit detector, the processing unit 120 may determine that the currentused by the motor 115 has exceeded a limit. If the limit detector is arotary encoder, the processing unit 120 may determine that therotational speed of the rotor shaft 150 has reached zero and/or whetherthe angular position of the rotor shaft 150 has reached a predeterminedangle.

At block 2435, a determination may be made whether the shutoff valveactuator has reached the target limit (e.g., a mechanical stop). If not,the processing may proceed to block 2420, which was described above.Otherwise, the processing may end.

In some aspects of the present embodiments, the shutoff valve actuator180 (FIG. 2) or the ball valve handle 1005 (FIG. 10) may be freerotating devices. For example, the ball valve connected to the shutoffvalve actuator 180 or the ball valve handle 1005 may be free rotatingball valves. The ball valve may open or close the fluid supply line 170(FIG. 1A) after each 90 degree turns but the valve may not have amechanical stop and may keep on rotating when a force or torque isapplied to it. A ball valve may initially have a mechanical stop thatmay become worn out over time, causing the ball valve to freely rotate.

In some of the present embodiments, the processing unit may learn thepositions of the rotor shaft when the valve is on or off. FIG. 25 is aschematic front view of a client device 2535 that may include anapplication program for identifying the position of the rotor shaft whenthe valve is on or off, according to various aspects of the presentdisclosure. The figure illustrates, through four stages 2501-2504, aclient device 2535 using an application program 2520 to identify theposition of the rotor shaft when the valve is on or off.

With reference to FIG. 25, stage 2501 shows a graphical user interface(GUI) 2532 displayed on a display (e.g., a touch screen) 2530 of theclient device 2535, which may include several selectable user interface(UI) items (e.g., icons) of several applications 2520-2527. As shown,the valve shutoff application 2520 is selected in stage 2501. Inresponse to the selection of the valve shutoff application 2520, the GUI2532 in stage 2502 may display several options 2540-2557. The valveshutoff application 2520 may be a program that is installed on theclient device 2535 to provision, setup, and/or control a valve shutoffdevice.

The “provision a valve shutoff device” option 2557 may be selected toassociate a valve shutoff device with the client device 2535. Forexample, the client device 2535 may be one of electronic devices 1205 inFIGS. 12A-12C and the client device 2535 and the valve shutoff device100 may be connect to the network(s) 1290. The client device and thevalve shutoff device may discover each other. The valve shutoff device100 may be provisioned to recognize the client device 2535 as a clientdevice that is authorized to communicate and exchange signals, commands,and data with the valve shutoff device 100.

During the provisioning, one or more data items related to the valveshutoff device may be set. For example, the GUI 2532 may include anoption (not shown) for entering the physical address and/or thegeographical coordinates (e.g., the latitude and the longitude) of thelocation where the shutoff valve is being installed. In some of thepresent embodiments, the valve shutoff device 100 may include a GPScomponent (e.g., a GPS receiver chip). In these embodiments, thelocation information (e.g., the geographical coordinates) may beautomatically set by the valve shutoff device without the client deviceintervention. The location information may be used, for example, to sendthe location of the valve shutoff device to one or more electronicdevices as described above with reference to FIG. 22. In the example ofFIG. 25, it is assumed that the valve shutoff device is alreadyprovisioned using the provision option 2557.

As shown in step 2502, the initial setup option 2555 may be selected. Inresponse to the selection of the initial setup option 2555, the GUI 2532in stage 2503 may display an incremental forward option 2561, anincremental backward option 2562, an option 2565 to confirm that thevalve is placed in the off position, and an option 2595 to exit. The GUI2532 may display a message 2560 requesting the valve shutoff device tobe connected to the manual shutoff valve and the incremental forward2561 and/or the incremental backward 2562 buttons to be repeatedlyselected until the valve is closed.

Each selection of the incremental forward 2561 option may cause theclient device 3335 to send a signal to the valve shutoff device 100 torotate the rotor shaft 150 by a number of degrees in a direction (e.g.,in clockwise or counter clockwise direction). Each selection of theincremental backward 2562 option may cause the client device 2535 tosend a signal to the valve shutoff device 100 to rotate the rotor shaft150 by a number of degrees in the opposite direction (e.g., in counterclockwise or clockwise direction).

In stage 2503, the option 2565 is selected (e.g., after the shutoffvalve is turned off by selecting options 25361 and/or 2562 one or moretimes). As described below with reference to FIG. 26, the client device2535 may send a signal to the processing unit 120 to measure and storethe current position of the rotor shaft 150 as the positioncorresponding to the shutoff valve being turned off.

In response to the selection of the option 2565, the GUI 2532 in stage2504 may display a message 2570 requesting the incremental forward 2561and/or the incremental backward 2562 buttons to be repeatedly selecteduntil the valve is opened. The GUI 2532, in stage 2504, may provide theincremental forward option 2561, the incremental backward option 2562,an option 2575 to confirm the valve is placed in the on position, and anoption 2580 to exit. In stage 2504, the option 2575 is selected (e.g.,after the shutoff valve is turned on by selecting options 25361 and/or2562 one or more times). As described below with reference to FIG. 26,the client device 2535 may send a signal to the processing unit tomeasure and store the current position of the rotor shaft 150 as theposition corresponding to the shutoff valve being turned on.

FIG. 26 is a flowchart illustrating an example process 2600 foridentifying the on and off positions of a shutoff valve, according tovarious aspects of the present disclosure. In some of the presentembodiments, the process 2600 may be performed by a processing unit ofthe client device 2535 of FIG. 25.

With reference to FIG. 26, at block 2605, a selection of an applicationfor controlling a valve shutoff device may be received. For example, aselection of the valve shutoff application 2520 may be received in stage2501 of FIG. 25. In response to the selection of the application, one ormore options related to the valve shutoff device may be displayed (atblock 2610). For example, options 2540-2557 may be displayed in stage2502 of FIG. 26.

At block 2615, a selection of the option to perform initial setup may bereceived. For example, a selection of the initial setup option 2555 maybe received in stage 2502 of FIG. 25. In response to the selection ofthe initial setup option, a message may be displayed (at block 2520) toconnect the valve shutoff device to the shutoff valve and repeatedlyselect an incremental forward option and/or an incremental backwardoption until the shutoff valve is closed. For example, the client device2535 may display the message 2560 of stage 2503 (FIG. 25).

Next, the option selected may be determined (at block 2625). When theselected option is the incremental forward or the incremental backward,one or more signals may be sent (at block 2630) to the valve shutoffdevice to rotate the rotor shaft in the selected direction. For example,the client device 2535 (FIG. 25) or an electronic device 1205 (FIGS.12A-12C) may send one or more signals to the valve shutoff device 100 torotate the rotor shaft 150 by a predetermined number of degrees (orturns, fraction of turn, etc.) in either clockwise or counter clockwisedirection based on which one of the incremental forward or theincremental backward options is selected. The processing may then returnto block 2625, which was described above.

With reference to FIG. 26, when the selected option at block 2625 isexit, the processing may end. For example, when the option 2595 of FIG.25 is selected, the valve shutoff application 2520 may be terminated.With further reference to FIG. 26, when the selected option is theconfirmation that the shutoff valve 175 is in the off position, one ormore signals may be sent (at block 2635) to the valve shutoff device tomeasure and store the current angular position of the rotor shaft as the“off” position. The signals may cause the processing unit 120 of thevalve shutoff device 100 to use, for example, the measurements providedby a rotary position encoder (FIGS. 13C-13D) while the rotor shaft 150was rotating to determine the position of the rotor shaft 150 when themotor stops.

Next, a message may be displayed (at block 2540) to repeatedly selectthe incremental forward option and/or the incremental backward optionuntil the valve is opened. For example, the client device 2535 maydisplay the message 2570 of stage 2504 (FIG. 25). Next, the optionselected may be determined (at block 2645). When the selected option isthe incremental forward or the incremental backward, one or more signalsmay be sent (at block 2650) to the valve shutoff device to rotate therotor shaft in the selected direction. For example, the client device2535 (FIG. 25) or an electronic device 1205 (FIGS. 12A-12C) may send oneor more signals to the valve shutoff device 100 to rotate the rotorshaft 150 by a predetermined number of degrees (or turns, fraction ofturn, etc.) in either clockwise or counter clockwise direction based onwhich one of the incremental forward or the incremental backward optionsis selected. The processing may then return to block 2645, which wasdescribed above.

With reference to FIG. 26, when the selected option is exit, theprocessing may end. For example, when the option 2580 of FIG. 25 isselected, the valve shutoff application 2520 may be terminated. Withreference to FIG. 26, when the selected option is the confirmation thatthe shutoff valve 175 is in the on position, one or more signals may besent (at block 2655) to the valve shutoff device to measure and storethe current angular position of the rotor shaft as the “on” position.The signals may cause the processing unit 120 of the valve shutoffdevice 100 to use, for example, the measurements provided by a rotaryposition encoder (FIGS. 13C-13D) while the rotor shaft 150 was rotatingto determine the position of the rotor shaft 150 when the motor stops.The processing may then end.

After the angular positions of the rotor shaft that correspond to the“on” and “off” positions of the shutoff valve are measured and stored bythe valve shutoff device, these positions may be used to move the rotorshaft to open or close the shutoff valve. FIG. 27 is a flowchartillustrating an example process 2700 for turning off a shutoff valve bya continuous rotation motor using the stored angular positions of therotor shaft that correspond to the “on” and/or “off” positions of theshutoff valve, according to various aspects of the present disclosure.In some of the present embodiments, the process 2700 may be performed bya processing unit 120 of a valve shutoff device 100 (FIG. 12C).

With reference to FIG. 27, blocks 2705-2715 are similar to blocks2305-2315 of FIG. 23, respectively. The details of blocks 2305-2315 and2705-2715 were described above with reference to FIGS. 17-22. At block2720, the current angular position of the rotor shaft may be received.For example, the processing unit 120 of FIG. 12C may receive the angularposition of the rotor shaft 150 from the rotary encoder limit detector1263.

The current angular position of the rotor shaft may then be compared (atblock 2725) with the “on” and/or the “off” angular positions of therotor shaft that are stored in memory. For example, the processing unit120 may compare the current angular position of the rotor shaft with theon” and/or the “off” angular positions of the rotor shaft that werestored by the valve shutoff device during the initial setup usingprocess 2600 (FIG. 26).

At block 2730 it may be determined whether the shutoff valve is in theoff position based on the comparison. When the shutoff valve is not inthe off position, one or more signals may be sent (at block 2735) to thecontinuous rotation motor to start rotating the rotor shaft to turn offthe shutoff valve. For example, the processing unit 120 may send one ormore signals to the motor 115 to start rotating the rotor shaft 150 inthe direction to close the shutoff valve. The processing may proceedback to block 2720, which was described above. Otherwise, when theshutoff valve is in the off position one or more signals may be sent (atblock 2740) to the continuous rotation motor to stop rotating. Theprocessing may then end.

FIG. 28 is a flowchart illustrating an example process 2800 for turningoff a shutoff valve by a motor that has position control using thestored angular positions of the rotor shaft that correspond to the “on”and/or “off” positions of the shutoff valve, according to variousaspects of the present disclosure. In some of the present embodiments,the process 2800 may be performed by a processing unit 120 of a valveshutoff device 100 (FIG. 12C).

With reference to FIG. 28, blocks 2805-2815 are similar to blocks2305-2315 of FIG. 23, respectively. The details of blocks 2305-2315 and2805-2815 were described above with reference to FIGS. 17-22. At block2820, the current angular position of the rotor shaft may be received.For example, the processing unit 120 of FIG. 12C may receive the angularposition of the rotor shaft 150 from the rotary encoder limit detector1263. The processing unit 120 may, for example, use the rotary positionencoder limit detector (e.g., the optical rotary position encoder ofFIG. 13C or the magnetic rotary position encoder of FIG. 13D) todetermine and store the angular position of rotor shaft 150 each timethe motor comes to a stop.

With further reference to FIG. 28, the number of degrees to turn therotor shaft in order to turn off the shutoff valve may be determined (atblock 2825) by comparing the current angular position of the rotor shaftwith the off angular position of the rotor shaft stored in memory. Theoff angular position of the rotor shaft may be stored by the processingunit 120 during the initial setup using process 2600 (FIG. 26).

Next, the direction of the rotation of the rotor shaft may be determined(at block 2830). For example, the direction to turn off the shutoffvalve may be clockwise (or counter clockwise direction depending on thevalve design). Next, one or more signals may be sent (at block 2835) tothe motor that has position control to rotate to turn the rotor shaft inthe determined direction to the “off” position that is stored in memory.Since the motor has position control, the motor does not requirereceiving separate signals to stop. The processing may then end.

In addition to turning off a shutoff valve based on the analysis ofseismic waves, some of the present embodiments may turn the shutoffvalve on or off based on signals that are received from authorizedremote devices. The valve shutoff device, in these embodiments mayoperate as an IoT device. FIG. 29 is a functional block diagramillustrating a system for remotely turning a shutoff valve on or off bya cloud or backend server using a valve shutoff device, according tovarious aspects of the present disclosure.

With reference to FIG. 29, a cloud or backend server 130 may send one ormore signals 2905 to one or more valve shutoff devices 2901-2903 to turnthe shutoff valve(s) on or off. The cloud or backend server 1210 may beassociated with one or more government agencies and/or utility companiessuch as, without limitations, firefighting department, civil defense,gas company, water company, etc. The shutoff valves devices 2901-2903may be installed in different properties. The cloud or backend server1210 may send the signal(s) 2905 to many valve shutoff devices 2901-2903during an emergency event such as an earthquake, fire, war, explosion,landslide, etc., to turn off the associated shutoff valves. The cloud orbackend server 1210 may send the signal(s) 2905 to an individual valveshutoff device to turn the corresponding shutoff valve on or off, forexample when a utility subscriber takes possession or leaves a premisewhere the shutoff valve is installed (e.g., a utility company mayremotely shutoff the gas shutoff valve of a property when a utilitycompany's customer informs the utility company that the customer nolonger lives in the premise.

With reference to FIG. 29, the signal(s) 2905 may go through thenetwork(s) 1290 and may be received by the valve shutoff devices2901-2903 that may be associated with different properties. The valveshutoff devices 2901-2903 may determine that the cloud/backend server30310 is authorized to send the signal(s), and may turn the associatedshutoff valves on or off based on the received signal. The valve shutoffdevices 2901-2903 may send their status and device identification 2910to the cloud or backend server 1210. The status may include anindication that the shutoff valve has or has not been successfullyturned on or off.

FIG. 30 is a functional block diagram illustrating a system for remotelyturning a shutoff valve on or off by a client device using a valveshutoff device, according to various aspects of the present disclosure.The client device 3005 may be a client device such as the client device2535 associated with a particular valve shutoff device. In the exampleof FIG. 30, the valve shutoff device 2902 is provisioned to beassociated with the client device 3005.

With reference to FIG. 30, the client device 3005 may send one or moresignals 3005 to turn the valve shutoff device 2902 associated with theclient device on or off. For example, the user of the client device mywish to turn off the valve shutoff before going to a trip or turn on thevalve shutoff after coming back from the trip. The user may, forexample, be away from the property where the shutoff valve is installedand may wish to turn off the shutoff valve after hearing news about anearthquake, fire, or other emergency or disaster events.

With further reference to FIG. 30, the signal(s) 3005 may go through thenetwork(s) 1290 and may be received by the valve shutoff device 2902that may be associated with the client device. The valve shutoff device2902 may determine that the client device 3005 is authorized to send thesignal(s) to the valve shutoff device 2902, and may turn the associatedshutoff valve on or off (based on the received signal). The valveshutoff 2902 may send its status and device identification 3010 to theclient device 3005. The status may include an indication that theshutoff valve has or has not been successfully turned on or off. Theother valve shutoff devices 2901 or 2903 that are not associated withthe client device 3005 may ignore the signal(s) 3010 even if the valveshutoff devices 2901 or 2903 receive the signal(s) 3010 from the clientdevice 3005 through the network 1290.

FIG. 31 is a schematic front view of a client device that may include anapplication program for remotely turning a shutoff valve on or off,according to various aspects of the present disclosure. The figureillustrates, through three stages 3101-3103, a client device 2535 usingan application program 2520 to remotely turn a shutoff valve on or off.

With reference to FIG. 31, stage 3101 shows a graphical user interface(GUI) 3132 displayed on a display (e.g., a touch screen) 2530 of theclient device 2535. In the example of FIG. 31, the client device 2535 instage 3101 is displaying a news channel 3105 that is unrelated to thevalve shutoff application 2520. As shown in this example, the newschannel 3105 may display news 3110 regarding an earthquake in a citynear the property where a shutoff valve associated with the clientdevice 2535 is installed.

As shown in stage 3101, a control button 3180 is selected to exit thenews channel. In response to the selection of the control button 3180,the GUI 3132 may display a list of applications 2520-2527 in stage 2502.As shown, the valve shutoff application 2520 may be selected in stage3102. In response to the selection of the valve shutoff application2520, the GUI 3132 in stage 3103 may display several options 2540-2557.In the example of FIG. 31, it is assumed that the valve shutoff deviceis already provisioned using the provision option 2557.

As shown in step 3103, the turn off valve option 2545 may be selected.As described below with reference to FIG. 32, the client device 2535 maysend one or more signals to the processing unit 120 (FIGS. 12A-12C) ofthe valve shutoff device 100 to turn off the shutoff valve 175.Similarly, a selection of the option 2540 may cause the client device2535 to send one or more signal to the processing unit 120 of the valveshutoff device 100 to turn on the shutoff valve 175.

FIG. 32 is a flowchart illustrating an example process 3200 for using acontinuous rotation motor to open or close a shutoff valve that has amechanical stop, in response to receiving a signal from a remote device,according to various aspects of the present disclosure. A continuousrotation motor may be a motor without an internal feedback loop tocontrol the position of the motor's rotor shaft. In some of the presentembodiments, the process 3200 may be performed by the processing unit120 (FIG. 12A-12C).

With reference to FIG. 32, one or more signals may be received (at block3205) from a device external to the valve shutoff device to open (orclose) a shutoff valve on a fluid supply line. For example, theprocessing unit 120 (FIGS. 12A-12C) may receive a signal from the clientdevice 2535 (FIG. 31) after one of the options 2540 or 2545 is selectedin stage 3103.

With further reference to FIG. 32, a determination may be made (atblock) 3210 whether the external device is authorized to request to openor close the shutoff valve. For example, the processing unit 120 of thevalve shutoff device 100 may determine whether the external device isauthorized to turn the shutoff valve on or off as a part of theprovisioning of the valve shutoff device 100. The valve shutoff device100 may be provisioned to be associated with one or more electronicdevices 1205 (FIGS. 12A-12C) such as the client device 2535 (FIG. 25)that are authorized to send signals (e.g., to request for health statusand data, request to turn the shutoff valve on or off, perform initialsetup, etc.) to the valve shutoff device 100. The valve shutoff device100 may be provisioned to be associated with one or more cloud orbackend servers 1210 (FIGS. 12A-12C) that are authorized to send signals(e.g., to request for health status and data, request to turn theshutoff valve on or off, etc.) to the valve shutoff device 100.

With reference to FIG. 32, when the external device is not authorized tosend the signal(s) to turn the shutoff valve on or off, the processingmay end. Otherwise, one or more signals may be sent (at block 3215) tothe continuous rotation motor to start rotating the rotor shaft in thedirection to open (or close) the valve. For example, the processing unit120 (FIGS. 12A-12B) may send a signal to the motor 150 to start rotatingthe rotor shaft in to turn off the shutoff valve 175.

At block 3220, one or more parameters from a limit detector may bereceived. Since the motor in the example of process 3200 is a continuousrotation motor and the shutoff valve actuator 1281 has a mechanicalstop, the processing unit 120 has to know when the shutoff valveactuator is no longer rotating in order to turn off the motor. The limitdetector, in some of the present embodiments, may be a force or torquelimit detector 1261 (FIGS. 12A and 13A) and the parameters received fromthe limit detector 1261 may include measurements of force and/or torqueexerted on the rotor shaft 150.

The limit detector in some embodiments may be a motor current limitdetector 1262 (FIGS. 12B, 13B) and the parameters received from thelimit detector 1262 may include measurements of electrical current usedby the motor 115. The limit detector in some embodiments may be a rotaryposition encoder 1263 such as the optical rotary position encoder ofFIG. 13C or the magnetic rotary position encoder of FIG. 13D and themeasurements may include the position and/or the speed of the rotorshaft 150.

With further reference to FIG. 32, the parameters received from thelimit detector may be analyzed (at block 3225) to determine whether theshutoff valve actuator has reached the mechanical stop and the shutoffvalve is turned on or off. For example, if the limit detector is a forceor torque limit detector, the processing unit 120 may determine whetherthe force or torque exerted on the rotor shaft 150 has exceeded a limit.If the limit detector is a motor current limit detector, the processingunit 120 may determine that the current used by the motor 115 hasexceeded a limit. If the limit detector is a rotary encoder, theprocessing unit 120 may determine that the rotational speed of the rotorshaft 150 has reached zero and/or whether the angular position of therotor shaft 150 has reached a predetermined angle.

At block 3230, a determination may be made whether the shutoff valve isopen (or close). For example, a determination may be made whethershutoff valve actuator 180 has reached the mechanical stop. If not, theprocessing may proceed to block 3220, which was described above.Otherwise, one or more signals may be sent (at block 3235) to thecontinuous rotation motor to stop rotating the shaft. The processing maythen end.

FIG. 33 is a flowchart illustrating an example process 3300 for using amotor that has position control to turn a shutoff valve that has amechanical stop on or off, in response to receiving a signal from aremote device, according to various aspects of the present disclosure.In some of the present embodiments, the process 3300 may be performed bythe processing unit 120 (FIG. 12A-12C).

With reference to FIG. 33, blocks 3305-3310 are similar to blocks3205-3210 of FIG. 32 respectively, which were described above. At block3320, one or more signals may be sent to the motor that has positioncontrol to rotate the rotor shaft by a predetermined number of degrees(or number of turns). For example, the processing unit 120 may send oneor more signals or commands to the motor 115 to turn the rotor shaft 150by a number of degrees. The rotor shaft 150 may be connected to thevalve coupling key 145, which in turn may be engaged with the shutoffvalve level 180.

The shutoff valve actuator 180 may, for example, be the shutoff valvelever 180 (FIG. 2) or the ball valve handle 1005 (FIG. 10) thattypically turns 90 degrees from open to close. The processing unit 120may not know whether the shutoff valve is currently open, closed, orpartially closed. The shutoff valve actuator 180 may, for example, bethe gate valve handwheel 800 (FIG. 8) that may need to be turned aroundseveral times in order to be closed. The processing unit 120 may notknow the current position of the handwheel and/or how many turns thehandwheel 800 has be turned to close. The processing unit may,therefore, send one or more signals or commands to the motor (at block3320) to turn the rotor shaft 150 in a direction that closes the valveand check one or more parameters to make sure the shutoff valve actuator180, the handle 1005, or the handwheel 800 have reached the mechanicalstop and the valve is closed.

With further reference to FIG. 33, one or more measurements may bereceived (at block 3325) from a limit detector. The limit detector maybe one of the limit detectors described above with reference to block2325 of FIG. 23. The limit detector may be external to or an integralpart of the motor. For example, the limit detector may be apotentiometer that is integral to the motor.

With continued reference to FIG. 33, the parameters received from thelimit detector may be analyzed (at block 3330) to determine whether theshutoff valve actuator has reached the mechanical stop. For example, ifthe limit detector is a force or torque limit detector, the processingunit 120 may determine whether the force or torque exerted on the rotorshaft 150 has exceeded a limit. If the limit detector is a motor currentlimit detector, the processing unit 120 may determine that the currentused by the motor 115 has exceeded a limit. If the limit detector is arotary encoder, the processing unit 120 may determine that therotational speed of the rotor shaft 150 has reached zero and/or whetherthe angular position of the rotor shaft 150 has reached a predeterminedangle.

At block 3335, a determination may be made whether the shutoff valveactuator has reached the mechanical stop. If not, the processing mayproceed to block 3320, which was described above. Otherwise, theprocessing may end.

FIG. 34 is a flowchart illustrating an example process 3400 for openingor closing a shutoff valve by a continuous rotation motor using thestored angular positions of the rotor shaft that correspond to the openor close positions of the shutoff valve, in response to receiving asignal from a remote device, according to various aspects of the presentdisclosure. In some of the present embodiments, the process 3400 may beperformed by a processing unit 120 of a valve shutoff device 100 (FIG.12C).

With reference to FIG. 34, blocks 3405-3410 are similar to blocks3205-3210 of FIG. 32, respectively. At block 3415, the current angularposition of the rotor shaft may be received. For example, the processingunit 120 of FIG. 12C may receive the angular position of the rotor shaft150 from the rotary encoder limit detector 1263.

The current angular position of the rotor shaft may then be compared (atblock 3420) with the “on” and/or the “off” angular positions of therotor shaft that are stored in memory. For example, the processing unit120 may compare the current angular position of the rotor shaft with theon” and/or the “off” angular positions of the rotor shaft that werestored by the valve shutoff device during the initial setup usingprocess 2600 (FIG. 26).

At block 3425 it may be determined whether the shutoff valve is in theoff position based on the comparison. When the shutoff valve is not inthe off position, one or more signals may be sent (at block 3430) to thecontinuous rotation motor to start rotating the rotor shaft to turn offthe shutoff valve. For example, the processing unit 120 may send one ormore signals to the motor 115 to start rotating the rotor shaft 150 inthe direction to close the shutoff valve. The processing may proceedback to block 3415 which was described above. Otherwise, when theshutoff valve is in the off position one or more signals may be sent (atblock 3435) to the continuous rotation motor to stop rotating. Theprocessing may then end.

FIG. 35 is a flowchart illustrating an example process 3500 for openingor closing a shutoff valve by a motor that has position control usingthe stored angular positions of the rotor shaft that correspond to theopen or close positions of the shutoff valve, in response to receiving asignal from a remote device, according to various aspects of the presentdisclosure. In some of the present embodiments, the process 3500 may beperformed by the processing unit 120 (FIG. 12A-12C).

With reference to FIG. 35, blocks 3505-3510 are similar to blocks3205-3210 of FIG. 32 respectively, which were described above. At block3515, the current angular position of the rotor shaft may be determined.For example, the processing unit 120 in FIG. 12C may use a rotaryposition encoder limit detector (such as the optical rotary positionencoder of FIG. 13C or the magnetic rotary position encoder of FIG. 13D)to determine and store the angular position of rotor shaft 150 each timethe motor comes to a stop.

With further reference to FIG. 35, the number of degrees to turn therotor shaft may be determined (at block 3520) by comparing the currentangular position of the rotor shaft with the on (or off) angularposition of the rotor shaft stored in memory. Next, the direction of therotation of the rotor shaft may be determined (at block 3525). Forexample, if the request from the external device is for turning theshutoff valve off, the direction of rotation may be clockwise (orcounter clockwise direction depending on the valve design). If therequest from the external device is for turning the shutoff valve on,the direction of rotation may be in the opposite direction counterclockwise (or clockwise direction depending on the valve design).

Next, one or more signals may be sent (at block 3530) to the motor thathas position control to rotate to turn the rotor shaft in the determineddirection to the “on” (or “off”) position that are stored in memory. Forexample, if the signal received from the external device is for turningoff the shutoff valve, the signal(s) sent (at block 3530) to the motormay rotate the rotor shaft by a number of degrees in the direction toturn the shutoff valve off. If the signal received from the externaldevice is for turning on the shutoff valve, the signal) sent (at block3530) to the motor may rotate the rotor shaft by a number of degrees inthe direction to turn the shutoff valve on. The processing may then end.

The valve shutoff devices in some of the present embodiments arecompatible with the IoT specification. With the advent of the IoT, it isdesirable to collect health status and data by an automatic valveshutoff device and report the health status and data to one or moreexternal devices. The IoT is the extension of the Internet connectivityinto physical devices. In some of the present embodiments, the valveshutoff device 100 (FIGS. 12A-12C) may include one or more sensors tocollect data from different components of the valve shutoff device 100.

The processing unit 120 of a valve shutoff device 100 may receive and/orstore the sensor data. The processing unit 120 may receive and/or storedata from different components. The processing unit 120 may measureand/or store voltage and/or current levels received from differentcomponents. The processing unit 120 may compare the received and/orstored data with different thresholds to determine the health status ofdifferent components. The processing unit 120 may send the health statusand/or data to one or more authorized external devices either on a pullbasis upon receiving a request or on a push basis after detecting anevent such as a component failure, major seismic activities, and/or on apush basis as a periodic report.

FIG. 36 is a functional block diagram illustrating a system 3600 forreporting health status and data by one or more valve shutoff devices toone or more external devices, according to various aspects of thepresent disclosure. With reference to FIG. 36, one or more valve shutoffdevices 2901-2903 may collect device status and/or seismic activitymeasurements. The valve shutoff devices 2901-2903 may be installed atdifferent properties. The valve shutoff devices 2901-2903 may send (asshown by 3605) the device status, seismic activity measurements, and/ordevice identification to one or more cloud or backend servers 1210.

The cloud or backend servers 1210 may store the device status, seismicactivity measurements, and/or device IDs in a database 3650. The cloudor backend servers 1210 may use the collected information to estimatethe intensity of seismic activities in specific areas (e.g., where oneor more of the valve shutoff devices 2901-2903 are located, may assessthe health status of the valve shutoff devices 2901-2903, etc.

Sending of the device status, device ID, and/or seismic activitymeasurements may be done on a pull basis, e.g., when the cloud or backend server(s) 1210 send(s) (as shown by 3610) a request for data.Sending of the device status, device ID, and/or seismic activitymeasurements may be done on a push basis after detecting an event suchas a component failure, major seismic activities, and/or on a push basisas a periodic report.

FIG. 37 is a functional block diagram illustrating a system 3700 forreporting health status and data by a valve shutoff device to one ormore client devices associated with the valve shutoff device, accordingto various aspects of the present disclosure. With reference to FIG. 37,a valve shutoff device 2902 may collect device status. The valve shutoffdevice 2902 may send (as shown by 3705) the device status and/or deviceidentification to one or more client devices 3705.

The client device(s) 3705 may store the device status and/or device ID.The client device(s) 3705 may display the device status and/or device IDon the display of the client device(s), for example, as described belowwith reference to FIG. 39.

Sending of the device status and/or device ID may be done on a pullbasis, e.g., when the client device(s) 3705 send(s) (as shown by 3710) arequest for data. Sending of the device status and/or device may be doneon a push basis after detecting an event such as a component failure,major seismic activities, and/or on a push basis as a periodic report.

The client device(s) 3705 may send software updates and/or data 3715 tothe valve shutoff device 2902. For example, and without limitations, theclient device may send software updates for the processing unit 120(FIGS. 12A-12C). The client device may send data, for example, andwithout limitations, as described above with reference to FIG. 25, thephysical address and/or the geographical coordinates of the locationwhere the valve shutoff device is installed. The client device may senddifferent parameters of the algorithm used for the identification anddetermination of the intensity of the seismic waves (as described abovewith reference to FIGS. 17-22) either as a single data item or as a partof a software update.

FIG. 38 is a flowchart illustrating an example process 3800 forcollecting health status and data by a valve shutoff device andreporting the health status and data to one or more external devices,according to various aspects of the present disclosure. In some of thepresent embodiments, the process 3800 may be performed by the processingunit 120 (FIG. 12A-12C).

With reference to FIG. 38, data from one or more sensors and one or morecomponents of the valve shutoff device may be received (at block 3805).The sensor and/or component data may include, without any limitations,one or more of the battery charge level, the health status of theprocessing unit 120 (FIGS. 12A-12C), the health status of the IMU, thehealth status of the radio transceiver, the health status of the limitdetector, the current position of the shutoff valve (determined, forexample, from the current angular position of the rotor shaft or fromthe last time the shutoff valve was automatically turned on or off bythe valve shutoff device 100).

The processing unit 120 may, for example, measure the current and/orvoltage received from the battery to determine the charge level of thebattery. The processing unit 120 may receive internal health status fromthe IMU, radio transceiver, limit detector circuitry, etc. Theprocessing unit 120 may check its own health status. The processing unit120 may check the health status of the battery 150 and may determinethat the battery has to be replaced. The processing unit 120 may alsoanalyze the parameters received from the IMU and may determine theintensity of seismic activity as a data item to be stored and/orreported.

With further reference to FIG. 38, the received data may be compared (atblock 3810) with one or more limits to determine whether the data hasexceeded the limit(s). Next, a determination may be made (at block 3815)whether the data has to be reported. If the valve shutoff device datareporting is on a pull basis, the determination (at block 3815) toreport data may be based on whether a request for data or status isreceived from an external device such as an authorized client device oran authorized could or backend server. If the valve shutoff device datareporting is on a pull basis, the determination (at block 3815) toreport data may be based on a determination that the received data hasexceeded the one or more limits and/or whether a time for a periodicreport has reached.

When the determination is made (at block 3815) not to report the data,the processing may proceed to block 3825, which is described below.Otherwise, the data and/or the device ID may be sent (at block 3820) toone or more devices external to the valve shutoff device. The data maybe stored (at block 3825) in the valve shutoff device's memory. Theprocessing may then end.

FIG. 39 is a schematic front view of a client device that may include anapplication program for displaying health and status data collected by ashutoff valve on or off, according to various aspects of the presentdisclosure. The figure illustrates, through three stages 3901-3903, aclient device 2535 using an application program 2520 to display healthstatus and data received from shutoff valve on or off.

With reference to FIG. 39, stage 3901 shows a graphical user interface(GUI) 3932 displayed on a display (e.g., a touch screen) 2530 of theclient device 2535. The GUI 3932 may display a list of applications2520-2527. As shown, the valve shutoff application 2520 may be selectedin stage 3901. In response to the selection of the valve shutoffapplication 2520, the GUI 3932 in stage 3902 may display several options2540-2557. In the example of FIG. 39, it is assumed that the valveshutoff device is already provisioned using the provision option 2557.

As shown in step 3902, the get status option 2550 may be selected. Inresponse to the selection of the get status option 2550, the GUI 3932may display health and status data received from the valve shutoffdevice 100 in stage 3903. In the example of FIG. 39, the health andstatus data may include one or more of the valve position 3911, thebattery level 3912, the health status 3913 of the processing unit, thehealth status 3914 of the IMU (displayed as seismic waves measurementunit), the health status 3915 of the radio transceiver, the healthstatus 3915 of the limit detector (displayed as motor feedbackcircuitry).

The GUI 3932 may provide a scroll down option 3991 and a scroll upoption 3992 to display additional health status and data (if any). TheGUI 3932 may provide an option 3985 to return to the previous stage.

In some of the present embodiments, the valve shutoff device 100 mayinclude one or more lights (e.g., one or more LED lights for display thestatus of different components of the valve shutoff device 100. FIG. 40is a schematic front view of a set of status lights of an automaticvalve shutoff device, according to various aspects of the presentdisclosure. The lights may, for example be emitted from LED lights thatare visible through corresponding holes or glass windows on theautomatic valve shutoff device′ housing 140 (FIGS. 1A-1B).

As shown, the lights may show the status of different components of thevalve shutoff device and/or the valve. The lights may, for example beturned on by the processing unit 120 of the automatic valve shutoffdevice when the corresponding component has failed a health check oralternatively the lights may be turned on when the correspondingcomponent is healthy. A light may also show whether the shutoff valve isautomatically opened or closed by the automatic valve shutoff device.

In the example of FIG. 40, the lights may include one or more of thefollowing lights. A light 4011 to show the valve position, a light 4012to indicate whether the battery level is low, a light 4013 to indicatethe health status of the processing unit, a light 4014 to indicate thehealth status of the IMU, a light 4015 to indicate the health status ofthe radio transceiver, a light 4016 to indicate the health status of thelimit detector.

In some of the present embodiments, the automatic valve shutoff devicemay have a display and keyboard panel (e.g., a touchscreen or a screenand a separate set of buttons). The display may be used to provision, toperform initial setup, to turn on or off, and/or to display the healthstatus of the automatic valve shutoff device. The display and thekeyboard panel may function similar to the functions performed by theclient device 2535 in stages 2502-2504 (FIG. 25), stage 3103 (FIG. 31),and/or stages 3902-3903 (FIG. 39).

The electronic devices such as the valve shutoff devices, the electronicdevices, the client devices, and/or the servers described above mayinclude memory. The memory 1250 in the above examples may be one or moreunits of similar or different memories. For example, the electronicdevices' memory may include, without any limitations, random accessmemory (RAM), read-only-memory (ROM), read-only compact discs (CD-ROM),erasable programmable read-only memories (EPROMs), electrically erasableprogrammable read-only memories (EEPROMs), flash memory (e.g., secureddigital (SD) cards, mini-SD cards, micro-SD cards, etc.), magneticand/or solid state hard drives, ultra-density optical discs, any otheroptical or magnetic media, and floppy disks.

Electronic devices such as the valve shutoff device, the client devices,and the servers described above may include one or more processingunits. For example, the processing unit 120 in above examples may be asingle processor or a multi-core processor in different embodiments. Theelectronic devices in some of the present embodiments may store computerprogram instructions in the memory, which may be a machine-readable orcomputer-readable medium (alternatively referred to as computer-readablestorage medium, machine-readable medium, or machine-readable storagemedium). The computer-readable medium may store a program that isexecutable by at least one processing unit and includes sets ofinstructions for performing various operations. Examples of programs orcomputer code include machine code, such as is produced by a compiler,and files including higher-level code that are executed by a computer,an electronic component, or a microprocessor using an interpreter. Fromthese various memory units, the processing unit may retrieveinstructions to execute and data to process in order to execute theprocesses of the present embodiments.

As used in this disclosure and any claims of this disclosure, the termssuch as “processing unit,” “processor,” “controller,” “microcontroller,”“server”, and “memory” all refer to electronic or other technologicaldevices. These terms exclude people or groups of people. For thepurposes of this disclosure, the terms display or displaying meansdisplaying on an electronic device. As used in this disclosure and anyclaims of this disclosure, the terms “computer readable medium,”“computer readable media,” and “machine readable medium” are entirelyrestricted to tangible, physical objects that store information in aform that is readable by a processing unit. These terms exclude anywireless signals, wired download signals, and any other ephemeralsignals.

In a first aspect, a valve shutoff device comprises: a coupling key forcoupling with an actuator of a shutoff valve on a fluid supply line; aninertial measurement unit for generating one or more signals in responseto arrival of seismic waves; a motor for rotating the coupling key andthe actuator of the shutoff valve; a radio transceiver; and a processingunit for: receiving the one or more signals from the inertialmeasurement unit; analyzing the received signals to determine whether toclose the shutoff valve; based on the analysis, sending a signal to themotor to rotate the coupling key and the actuator of the shutoff valveto close the shutoff valve; and sending one or more signals through thetransceiver to one or more electronic devices external to the valveshutoff device indicating whether the shutoff valve is open or closed.

In an embodiment of the first aspect, the processing unit is for:receiving a set of parameters from one or more of the inertialmeasurement unit, the processing unit, the motor, and the radiotransceiver; analyzing the set of parameters; determining a status ofthe valve shutoff device based on the analysis; and sending, through theradio transceiver, the status to the one or more electronic devices.

In another embodiment of the first aspect, the status comprises one ormore of a health status of the inertial measurement unit, a healthstatus of the processing unit, a health status of the motor, and ahealth status of the radio transceiver.

In another embodiment of the first aspect, the valve shutoff devicefurther comprises: a battery; and one or more solar cells for rechargingthe battery; wherein the processing unit is for: receiving one or moreparameters from the battery and the solar cells; analyzing the set ofparameters received from the battery and the solar cells; determining ahealth status of the battery and the solar cells based on the analysis;and sending, through the radio transceiver, the health status of thebattery and the solar cells to the one or more electronic devices.

In another embodiment of the first aspect, the valve shutoff devicefurther comprises: a radio frequency (RF) antenna, wherein theprocessing unit, the radio transceiver, and the RF antenna are on asystem on a chip integrated circuit.

In another embodiment of the first aspect, the processing unit isfurther for: analyzing the signals received from the inertialmeasurement unit for signs of an earthquake; determining that anearthquake exceeding a predetermined magnitude has occurred based on theanalysis; and sending, through the radio transceiver, at least one ofthe received signals to the one or more electronic devices as parametersrelated to the earthquake.

In another embodiment of the first aspect, the processing unit isfurther for: receiving a signal from an electronic device external tothe valve shutoff device, through the radio transceiver, to close theshutoff valve; determining an authenticity of the received signals basedon one or more criteria; and sending a signal to the motor to rotate thecoupling key to close the shutoff valve when the received commands areauthenticated.

In another embodiment of the first aspect, the processing unit isfurther for: receiving a signal from an electronic device external tothe valve shutoff device, through the radio transceiver, to open theshutoff valve; determining an authenticity of the received signals basedon one or more criteria; and sending a signal to the motor to rotate thecoupling key to open the shutoff valve when the received commands areauthenticated.

In a second aspect, a valve shutoff device comprises: a coupling key forcoupling with an actuator of a shutoff valve on a fluid supply line; aninertial measurement unit for generating one or more signals in responseto arrival of seismic waves; a motor for rotating the coupling key andthe actuator of the shutoff valve; a processing unit for: receiving theone or more signals from the inertial measurement unit; analyzing thereceived signals to determine whether to close the shutoff valve; andbased on the analysis, sending a signal to the motor to rotate thecoupling key and the actuator of the shutoff valve to close the shutoffvalve.

In an embodiment of the second aspect, the processing unit is foranalyzing the signals received from the inertial measurement unit todetermine at least one of an amplitude and an arrival time of one ormore types of seismic waves.

In another embodiment of the second aspect, the detected types ofseismic waves comprise one or more of primary waves (P-waves), secondarywaves (S-waves), and surface waves.

In another embodiment of the second aspect, the valve shutoff devicefurther comprises a rotor shaft connected to the coupling key, whereinthe motor rotates the coupling key by turning the rotor shaft.

In another embodiment of the second aspect, the valve shutoff devicefurther comprises: a sensor for: measuring one or more parametersassociated with the rotor shaft; and sending the measured parameters tothe processing unit; wherein the processing unit is further for:receiving, after sending the signal to the motor to rotate the couplingkey to close the shutoff valve, the parameters associated with the rotorshaft from the sensor; analyzing the parameters associated with therotor shaft; and sending a signal to the motor to stop rotating therotor shaft based on the analyses of the parameters.

In another embodiment of the second aspect, the sensor is one of (i) atorsion load cell for measuring a strain that is proportional to one ofa torque and a force applied by the motor to the rotor shaft and (ii) atransducer for creating an electrical signal with a magnitudeproportional to one of a torque and a force applied by the motor to therotating shaft.

In another embodiment of the second aspect, the valve shutoff devicefurther comprises: a memory; the processing unit for: receiving, priorto sending the signal to the motor to rotate the coupling key to closethe shutoff valve, a first value corresponding to an angular position ofthe rotor shaft when the valve is at an open position and a second valuecorresponding to an angular position of the rotor shaft when the valveis at a shutoff position; and storing the first and second values in thememory; after sending the signal to the motor to rotate the coupling keyto close the shutoff valve, receiving the angular value of the rotorshaft at one or more time intervals; comparing the angular value of therotor shaft with the first and second values; and sending a signal tothe motor to stop rotating the rotor shaft based on the comparison.

In another embodiment of the second aspect, the valve shutoff devicefurther comprises: a rotary position encoder for: measuring an angularposition of the rotor shaft; converting the angular position into adigital signal; and sending the digital signal to the processing unit;wherein the processing unit is for using the digital signal as theangular value of the rotor for comparing to the first and second values.

In another embodiment of the second aspect, the processing unit is for:receiving, after sending the signal to the motor to rotate the couplingkey, a level of an electric current used by the motor; and sending asignal to the motor to stop rotating the coupling key when the level ofthe electric current used by the motor exceeds a threshold.

In another embodiment of the second aspect, the motor comprises a rotorshaft, wherein the valve shutoff device further comprises a plurality ofgears for transferring a rotational movement of rotor shaft to thecoupling key.

In another embodiment of the second aspect, the valve shutoff devicefurther comprises: a rechargeable battery for providing power to themotor, the processing unit, and the inertial measurement unit; and oneor more solar cells for recharging the battery from one of solar light,ambient light, and a power outlet.

In another embodiment of the second aspect, the valve shutoff device isa retrofit device that is externally attachable to the actuator of theshutoff valve.

In another embodiment of the second aspect, the fluid in the supply lineis one of natural gas, steam, liquid water, and a petroleum-derivedliquid, and wherein the motor is one of a continuous rotation motor anda motor with position control.

In another embodiment of the second aspect, the inertial measurementunit comprises a three-dimensional (3D) accelerometer for generatingsaid one or more signals in response to detection of seismic waves.

In another embodiment of the second aspect, the inertial measurementunit comprises a three-dimensional (3D) accelerometer and a 3Dmagnetometer, for generating said one or more signals in response todetection of seismic waves.

In another embodiment of the second aspect, the inertial measurementunit comprises one or more micro electro-mechanical system (MEMS)sensors.

In another embodiment of the second aspect, the valve shutoff devicefurther comprises: an optical rotary position encode comprising: a diskcomprising a plurality of apertures connected to the rotating shaft; alight source for passing lights on the disk after the rotor shaft startsrotating; a light sensor for receiving light through the apertures ofthe disk; and a signal conditioner for converting the light detected bythe light sensor into a digital signal and sending the digital signal tothe processing unit; wherein the processing unit is for using thedigital signal as the angular value of the rotor shaft for comparing tothe first and second values.

In another embodiment of the second aspect, the processing unit is for:receiving, after sending the one or more signals to the motor to rotatethe coupling key, a level of an electric current used by the motor; andsending a signal to the motor to stop rotating the coupling key based onthe level of the electric current used by the motor.

In another embodiment of the second aspect, the motor comprises a rotorshaft, wherein the valve shutoff device further comprises a plurality ofgears for transferring a rotational movement of rotor shaft to thecoupling key.

In another embodiment of the second aspect, valve shutoff device furthercomprises a weatherproof housing for covering the motor, the inertialmeasurement unit, the battery, and the processing unit.

In another embodiment of the second aspect, the housing comprises one ormore ridges for keeping one or more cable ties for wrapping around theshutoff valve on the fluid supply line and the valve shutoff device.

In another embodiment of the second aspect, the valve shutoff devicecomprises first and second sets of clamps for fastening the valveshutoff device to the fluid supply line, wherein the first set of pipeclamps is connected to a top portion of the housing and the second setof pipe clamps is connected to a bottom portion of the housing.

In another embodiment of the second aspect, the housing comprises one ormore of a polyvinyl carbonite (PVC) material, a plastic material, and ametal material.

In another embodiment of the second aspect, the housing is in a shape ofa pipe, wherein a hollow chamber of the pipe houses the motor, theinertial measurement unit, the battery, and the processing unit.

In another embodiment of the second aspect, the processing unit is oneof a controller, a microcontroller, a processor, and a microprocessor.

In another embodiment of the second aspect, the radio transceiver iscompatible with an Internet of Things (IoT) specification.

In another embodiment of the second aspect, the valve shutoff devicefurther comprises: a display; wherein the processing unit is furtherfor: determining a status of the valve shutoff device and the shutoffvalve on the fluid supply line; and displaying the status on the displayof the valve shutoff device.

In another embodiment of the second aspect, the valve shutoff devicefurther comprises: a set of light emitted diode (LED), lights; whereinthe processing unit is further for: determining a status of the valveshutoff device and the shutoff valve on the fluid supply line; anddisplaying the status using the LED lights.

The above description presents the best mode contemplated for carryingout the present embodiments, and of the manner and process of practicingthem, in such full, clear, concise, and exact terms as to enable anyperson skilled in the art to which they pertain to practice theseembodiments. The present embodiments are, however, susceptible tomodifications and alternate constructions from those discussed abovethat are fully equivalent. Consequently, the present invention is notlimited to the particular embodiments disclosed. On the contrary, thepresent invention covers all modifications and alternate constructionscoming within the spirit and scope of the present disclosure. Forexample, the steps in the processes described herein need not beperformed in the same order as they have been presented, and may beperformed in any order(s). Further, steps that have been presented asbeing performed separately may in alternative embodiments be performedconcurrently. Likewise, steps that have been presented as beingperformed concurrently may in alternative embodiments be performedseparately.

What is claimed is:
 1. A valve shutoff device, comprising: a couplingkey for coupling with an actuator of a shutoff valve on a fluid supplyline; an accelerometer for making acceleration measurements in threedirections; a motor for rotating the coupling key and the actuator ofthe shutoff valve; a radio transceiver; and a processing unit for:receiving the acceleration measurements from the accelerometer;determining an arrival of a first set of seismic waves comprisingprimary seismic waves (P-waves) when a ratio of a power magnitude of theacceleration measurements in a vertical direction with respect to avector sum of the power magnitude of the acceleration measurements inthe three directions exceeds a first threshold; after determining thearrival of the P-waves, determining an arrival of a second set ofseismic waves when the vector sum of the power magnitude of theacceleration measurements in the three directions exceeds a secondthreshold; after determining the arrival of the second set of seismicwaves, sending one or more signals to the motor to rotate the couplingkey and the actuator of the shutoff valve to close the shutoff valve;and sending one or more signals through the transceiver to one or moreelectronic devices external to the valve shutoff device indicatingwhether the shutoff valve is open or closed, wherein the processing unitis one of a microprocessor, a controller, a microcontroller, a singleprocessor, and a multi-core processor.
 2. The valve shutoff device ofclaim 1, wherein the processing unit is for: receiving an internalhealth status from one or more of the accelerometer, the processingunit, the motor, and the radio transceiver; and sending, through theradio transceiver, the internal health status of said one or more of theprocessing unit, the motor, and the radio transceiver to the one or moreelectronic devices.
 3. The valve shutoff device of claim 1 furthercomprising: a battery; and one or more solar cells for recharging thebattery; wherein the processing unit is for: receiving an internalhealth status from the solar cells; receiving a voltage level from thebattery; and sending, through the radio transceiver, the internal healthstatus of the solar cells and the voltage level of the battery to theone or more electronic devices.
 4. The valve shutoff device of claim 1,further comprising a radio frequency (RF) antenna, wherein theprocessing unit, the radio transceiver, and the RF antenna are on asystem on a chip integrated circuit.
 5. The valve shutoff device ofclaim 1, wherein the processing unit is further for: comparing the powermagnitude of the acceleration measurements received from theaccelerometer with a predetermined magnitude; determining that anearthquake exceeding the predetermined magnitude has occurred when thepower magnitude of the acceleration measurements exceeds thepredetermined magnitude; and sending, through the radio transceiver, atleast one of the acceleration measurements to the one or more electronicdevices as parameters related to an earthquake.
 6. The valve shutoffdevice of claim 1, wherein the processing unit is further for: receivinga signal from an electronic device external to the valve shutoff device,through the radio transceiver, to close the shutoff valve; determiningan authenticity of the received signal based on one or more criteria;and sending one or more signals to the motor to rotate the coupling keyto close the shutoff valve when the received signal is authenticated. 7.The valve shutoff device of claim 1, wherein the processing unit isfurther for: receiving a signal from an electronic device external tothe valve shutoff device, through the radio transceiver, to open theshutoff valve; determining an authenticity of the received signal basedon one or more criteria; and sending one or more signals to the motor torotate the coupling key to open the shutoff valve when the receivedsignal is authenticated.
 8. The valve shutoff device of claim 1, whereinthe processing unit is for analyzing the measurements received from theaccelerometer to determine at least one of an amplitude and an arrivaltime of one or more types of seismic waves.
 9. The valve shutoff deviceof claim 8, wherein the types of seismic waves comprise one or more ofthe P-waves, secondary waves (S-waves), and surface waves.
 10. The valveshutoff device of claim 1 further comprising a rotor shaft connected tothe coupling key, wherein the motor rotates the coupling key by turningthe rotor shaft.
 11. The valve shutoff device of claim 10 furthercomprising: a sensor for: measuring one or more parameters comprising aforce excreted by the motor on the rotor shaft; and sending the measuredparameters to the processing unit; wherein the processing unit isfurther for: receiving, after sending the signal to the motor to rotatethe coupling key to close the shutoff valve, the measured parametersfrom the sensor; comparing the force excreted by the motor on the rotorshaft with a limit to determine whether the actuator of the shutoffvalve has stopped rotating; and when the actuator of the shutoff valveis determined to have stopped rotating, sending a signal to the motor tostop rotating the rotor shaft.
 12. The valve shutoff device of claim 11,wherein the sensor is one of (i) a torsion load cell for measuring astrain that is proportional to one of a torque and a force applied bythe motor to the rotor shaft and (ii) a transducer for creating anelectrical signal with a magnitude proportional to one of the torque andthe force applied by the motor to the rotating shaft.
 13. The valveshutoff device of claim 10 further comprising: a memory; the processingunit for: receiving, prior to sending the one or more signals to themotor to rotate the coupling key to close the shutoff valve, a firstvalue corresponding to an angular position of the rotor shaft when thevalve is at an open position and a second value corresponding to anangular position of the rotor shaft when the valve is at a shutoffposition; storing the first and second values in the memory; aftersending the one or more signals to the motor to rotate the coupling keyto close the shutoff valve, receiving the angular value of the rotorshaft at one or more time intervals; comparing the angular value of therotor shaft with the first and second values; and sending a signal tothe motor to stop rotating the rotor shaft based on the comparison. 14.The valve shutoff device of claim 13 further comprising: a rotaryposition encoder for: measuring an angular position of the rotor shaft;converting the angular position into a digital signal; and sending thedigital signal to the processing unit; wherein the processing unit isfor using the digital signal as the angular value of the rotor forcomparing to the first and second values.
 15. The valve shutoff deviceof claim 1, wherein the processing unit is for: receiving, after sendingthe one or more signals to the motor to rotate the coupling key, a levelof an electric current used by the motor; and sending a signal to themotor to stop rotating the coupling key when the level of the electriccurrent used by the motor exceeds a threshold.
 16. The valve shutoffdevice of claim 1, wherein the motor comprises a rotor shaft, whereinthe valve shutoff device further comprises a plurality of gears fortransferring a rotational movement of the rotor shaft to the couplingkey.
 17. The valve shutoff device of claim 1 further comprising: arechargeable battery for providing power to the motor, the processingunit, and the accelerometer; and one or more solar cells for rechargingthe battery from one of solar light and ambient light.
 18. The valveshutoff device of claim 1, wherein the valve shutoff device is aretrofit device that is externally attachable to the actuator of theshutoff valve.
 19. The valve shutoff device of claim 1, wherein thefluid in the supply line is one of natural gas, steam, liquid water, andpetroleum-derived liquid, and wherein the motor is one of a continuousrotation motor and a motor with position control.
 20. The valve shutoffdevice of claim 1, wherein the accelerometer is a three-dimensional (3D)accelerometer for making said acceleration measurements in response tothe arrival of the seismic waves.
 21. The valve shutoff device of claim1 further comprising a three-dimensional (3D) magnetometer for detectinga local magnetic north and measuring three components of a magneticfield vector for determining an amount of magnetic north rotation withrespect to a geographical north.
 22. The valve shutoff device of claim1, wherein the accelerometer is a micro electro-mechanical system (MEMS)sensor.
 23. The valve shutoff device of claim 1 further comprising: arechargeable battery for providing power to the motor, the processingunit, and the accelerometer, wherein the rechargeable battery isrechargeable from a power outlet.
 24. The valve shutoff device of claim1, wherein the second set of seismic waves comprises secondary waves(S-Waves).
 25. The valve shutoff device of claim 1, wherein the secondset of seismic waves comprises surface waves.